/*!
 *  BUI 简介 
 *  
 *  v1.4.1 date: 2018-01-22
 *  
 *  BUI 是一个开放式的UI交互框架, 有着丰富的组件, 可以自由定制交互,快速开发WebApp,微信,还可以通过第三方平台开发混合移动应用.
 *
 *  BUI 专注移动快速开发
 *  -----------------------------------------------------------
 *  BUI Team
 *  部门: 政企体验创新部
 *  产品经理: 区柏荣
 *  代码设计: 王伟深 杨俊标
 *  产品设计师: 邝德如 范菊 唐竹晗
 *  -----------------------------------------------------------
 *  BUI 反馈邮箱: wangwsh@bingosoft.net
 *
 *  Copyright (c) 2016-2018
 */
var libs = window.Zepto || window.jQuery;
window.router = {};
var bui = function (e, t) {
    var n = {};
    return n.debug = !0, n.isWebapp, n.currentPlatform = "", n.log = !0, n.trace = !1, n["native"] = {}, n.config = {}, n.config.namespace = "bui", n.config.classNamePrefix = n.config.namespace + "-", n.config.version = "1.4.1", n.config.versionCode = 20180122, n.config.viewport = {
        zoom: !0,
        create: !0
    }, n.config.init = {auto: !0}, n.config.ready = {}, n.config.ajax = {}, n.config.back = {}, n.config.load = {}, n.config.getPageParams = {}, n.config.refresh = {}, n.config.run = {}, n.config.checkVersion = {}, n.config.dialog = {}, n.config.confirm = {}, n.config.alert = {}, n.config.hint = {}, n.config.prompt = {}, n.config.loading = {}, n.config.mask = {}, n.config.list = {}, n.config.listview = {}, n.config.scroll = {}, n.config.pullrefresh = {}, n.config.select = {}, n.config.sidebar = {}, n.config.slide = {}, n.config.actionsheet = {}, n.config.dropdown = {}, n.config.accordion = {}, n.config.stepbar = {}, n.config.rating = {}, n.config.number = {}, n.config.file = {}, n.config.fileselect = {}, n.config.upload = {}, n.config.download = {}, n.config.swipe = {}, n.config.router = {}, n.config.loader = {}, n.prefix = function (e) {
        return n.config.classNamePrefix + e
    }, n.showLog = function (e, t) {
        t = t || "";
        var i = "";
        "object" == typeof e && "message" in e && "name" in e ? i = e.message + ":" + e.name + "&&stack:" + e.stack : "string" == typeof e && (i = e), n.log && console.error(t + " " + i), n.trace && console.trace && console.trace()
    }, n.swipeDirection = function (e, t, n, i) {
        var a = t - e, r = i - n, o = Math.abs(a), l = Math.abs(r), s = 9, c = 3;
        return s > o && s > l ? !1 : o / l > c ? a > 0 ? "swiperight" : "swipeleft" : r > 0 ? "swipedown" : "swipeup"
    }, n.widget = function (e) {
        return e && e in this ? this[e] : this
    }, n.option = function (t, i) {
        if ("object" !== n["typeof"](t) && "undefined" == typeof i) return "string" == typeof t ? this.config[t] : this.config;
        if ("id" == t) return n.showLog("不允许修改控件的ID参数"), this;
        if (t && "object" === n["typeof"](t)) {
            var a = e.extend(this.config, t);
            return this.init(a)
        }
        if (this.config.hasOwnProperty(t)) {
            var r = {};
            r[t] = i;
            var a = e.extend(this.config, r);
            return this.init(a)
        }
        return this
    }, n
}(libs, window);
!function (e, t) {
    return e.on = function (e, t, n) {
        "function" == typeof t ? (n = t, t = this) : (n = n, t = t), t.handle = t.handle || {}, "undefined" == typeof t.handle[e] && (t.handle[e] = []), t.handle[e].push(n)
    }, e.off = function (t, n, i) {
        "function" == typeof n ? (i = n, n = this) : "function" == typeof i ? (i = i, n = n) : n = this, "undefined" === t ? n.handle = {} : "string" == typeof t && "function" == typeof i ? e.removeArray(i, n.handle[t]) : "string" == typeof t && (n.handle = {}, n.handle[t] = [])
    }, e.trigger = function (e) {
        try {
            if (this.handle[arguments[0]] instanceof Array) {
                var t = this.handle[arguments[0]], n = [].slice.apply(arguments);
                n.shift();
                for (var i = 0, a = t.length; a > i; i++) t[i].apply(this.self || this, n)
            }
        } catch (r) {
        }
    }, e
}(bui || {}, libs), function (e, t) {
    function n(t, n) {
        function i(t) {
            var i = 100, a = n || 540, r = document.head.parentNode, o = window.devicePixelRatio,
                l = document.documentElement.clientWidth, s = document.documentElement.clientHeight;
            parseInt(l) * parseInt(o), parseInt(s) * parseInt(o);
            return fontSize = t ? t : (l / a * i).toFixed(2), c = fontSize, e.config.viewport.zoom && (r.style.fontSize = c + "px"), e.trigger.call(e, "viewportinit"), this
        }

        function a(e) {
            return winWid
        }

        function r(e) {
            return winHei
        }

        function o(e) {
            return winWidth
        }

        function l(e) {
            return winHeight
        }

        function s(e) {
            return ratio
        }

        e.trigger.call(e, "viewportbefore");
        var c, u = document.querySelector("meta[name=viewport]"),
            d = "width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no";
        if (u) e.config.viewport.create && (u.content = d); else {
            var f = document.createElement("meta");
            f.name = "viewport", f.content = d;
            var h = document.head;
            e.config.viewport.create && h.appendChild(f)
        }
        var p = [240, 320, 360, 375, 384, 412, 414, 435, 480, 512, 540, 768, 1024, 1536, 2048, 2732],
            g = [44.44, 59.26, 66.67, 69.44, 71.11, 76.3, 76.67, 80.56, 88.89, 94.81, 100, 70, 70, 70, 70, 70],
            v = e.inArray(document.documentElement.clientWidth, p);
        return v > -1 && "undefined" == typeof t ? c = g[v] : i(t), {
            width: a,
            height: r,
            fontSize: c,
            screenWidth: o,
            screenHeight: l,
            ratio: s,
            init: i
        }
    }

    return e.viewport = n, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.loader = function (n) {
        function i(e) {
            return e = e || {}, y = t.extend({}, y, e), this
        }

        function r(e) {
            if ("undefined" == typeof e) return C;
            if ("object" == typeof e && "modules" in e) C = t.extend(!0, {}, C, e), O = C.modules; else if ("object" == typeof e && "moduleName" in e) {
                var n = o(e);
                O[e.moduleName] = n || {}, C = t.extend(!0, {}, C, {modules: O}), O = C.modules
            }
            return C
        }

        function o(e) {
            var n = {
                moduleName: "",
                template: "",
                depend: [],
                script: "",
                style: [],
                isDefined: !1,
                isLoaded: !1,
                callback: null,
                exports: null,
                dependExports: []
            }, i = {};
            e.moduleName in O && (i = O[e.moduleName]);
            var a = t.extend(!0, {}, n, i, e);
            return a
        }

        function l(t, n, i) {
            try {
                var a = s(), o = a.name
            } catch (l) {
            }
            var u = [], d = [];
            if ("undefined" == typeof t) return e.showLog("define第1个参数不能为空"), this;
            if ("function" == typeof t) i = t, t = o, n = []; else if ("object" === e["typeof"](t)) {
                var f = t;
                t = o, n = [], i = function () {
                    return f
                }
            } else "array" === e["typeof"](t) ? (i = n, n = t, t = o) : "function" == typeof n ? (t = t, i = n, n = []) : (t = t, n = n, i = i);
            var h = t in O ? O[t].script || a.src : a.src;
            if (y.trace && console.log("define", t), n.length) for (var p = 0; p < n.length; p++) {
                var g = n[p];
                g.indexOf(".css") > -1 ? g.indexOf("css!") > -1 ? d.push(g.substr(4)) : d.push(g) : (u.push(g), g in O || r({moduleName: g}))
            }
            if ("string" == typeof t && "function" == typeof i) {
                var v = function () {
                    S[t] = {};
                    var e = [c, S[t], O[o]], n = [];
                    u.length && u.forEach(function (e, t) {
                        n.push(O[e].exports)
                    });
                    var a = n.concat(e);
                    return i && i.apply(this, a)
                };
                r({moduleName: t, depend: u, style: d, script: h, callback: v})
            } else e.showLog("define " + t + "模块的参数格式不对");
            return this
        }

        function s() {
            var e, n, i = window.location.href, r = i.lastIndexOf("/") + 1, o = b || i.substr(0, r),
                l = document.currentScript;
            if (b = o, l) return e = l.src.substr(r), n = l.getAttribute("name") || e.substr("0", e.indexOf(y.scriptSuffix)), {
                name: n,
                src: e
            };
            try {
                a()
            } catch (s) {
                var c = s.stack || s.sourceURL || s.stacktrace || "", u = c.split(/[@ ]/g).pop(),
                    d = u.replace(/(:\d+)?:\d+$/i, ""), d = d.replace(new RegExp(b, "g"), "");
                if (l = t('script[src="' + d + '"]')[0]) n = l.getAttribute("name"); else {
                    var f = d.indexOf(y.scriptSuffix);
                    n = d.substr(0, f)
                }
            }
            return {name: n, src: d}
        }

        function c(t, n) {
            y.trace && console.log("require", t);
            var i = {};
            if (t && "string" == typeof t && (t = [t]), n && "function" != typeof n) return e.showLog("require第2个参数格式为function", "bui.loader.require"), i;
            try {
                u(t, function () {
                    if (f(x)) {
                        var e = [];
                        t.forEach(function (i, a) {
                            d(i), e.push(O[i] && O[i].exports), a === t.length - 1 && (n && n.apply(I, e || []), x = [])
                        })
                    }
                })
            } catch (a) {
                e.showLog(a, "bui.loader.require")
            }
            return this
        }

        function u(t, n) {
            return t = t || [], O = C.modules, t.forEach(function (i, a) {
                function r(e, i) {
                    var a = O[e];
                    a && a.depend && a.depend.length && u(a.depend, n), a && (a.isDefined = !0), i == t.length - 1 && n && n.apply(a)
                }

                var o = O[i];
                O[i] && O[i].style.length && v(O[i].style), e.compareArray(i, x) || x.unshift(i), o && o.isLoaded ? a == t.length - 1 && n && n.apply(o) : o && o.callback && !o.script ? r(i, a) : g(i, function () {
                    O[i] && O[i].style.length && v(O[i].style), r(i, a)
                }, function () {
                    a == t.length - 1 && n && n.apply(null)
                })
            }), x
        }

        function d(t) {
            O = C.modules;
            var n = "string" == typeof t ? O[t] || {} : t, i = n.depend || [], a = null, r = [];
            y.trace && console.log("execute", n.moduleName), n.dependExports = [];
            try {
                if (i.length) for (var o = 0; o < i.length; o++) {
                    var l = i[o], s = O[l];
                    s.isLoaded ? r[o] = s.exports : r[o] = d(s), s.isLoaded = !0, s.exports = r[o], n.dependExports.push(r[o])
                }
                a = n.isLoaded ? n.exports : n.callback && n.callback.apply(n, r), n.isLoaded = !0, n.exports = a || O[n.moduleName] && O[n.moduleName].exports || S[n.moduleName]
            } catch (c) {
                e.showLog(c, "bui.loader.execute")
            }
            return a
        }

        function f(e) {
            var t = !0, n = e || [];
            if (O = C.modules, n.length) n.forEach(function (e, n) {
                O[e] && O[e].isDefined === !1 && (t = !1)
            }); else for (var i in O) O[i] && O[i].isDefined === !1 && (t = !1);
            return t
        }

        function h(e) {
            var t = !0, n = e || [];
            if (O = C.modules, n.length) n.forEach(function (e, n) {
                O[e].isLoaded === !1 && (t = !1)
            }); else for (var i in O) O[i].isLoaded === !1 && (t = !1);
            return t
        }

        function p(t, n, i) {
            return "string" == typeof t ? t.indexOf(".css") > -1 ? (m(item), n && n(t)) : g(t, n, i) : t && "array" === e["typeof"](t) && t.forEach(function (e, a) {
                e.indexOf(".css") > -1 ? (m(e), a == t.length - 1 && n && n(t)) : a == t.length - 1 ? g(e, n, i) : g(e)
            }), this
        }

        function g(n, i, a) {
            var r, o = this;
            if (O = C.modules, "undefined" == typeof n || "" == n) return a && a.call(o, n), this;
            if (n in O) r = n, n = O[n].script || r + y.scriptSuffix; else {
                var l = n.indexOf(y.scriptSuffix);
                l > -1 ? (n = n, r = n.substr(0, l)) : (r = n, n += y.scriptSuffix)
            }
            var s = document.createElement("script") || {};
            s.type = "text/javascript", s.async = y.async, s.src = C.baseUrl + n + (y.cache ? "" : "?t=" + (new Date).getTime()), s.setAttribute("name", r), s.onload = function () {
                y.trace && console.log("create", n), i && i(n)
            }, s.onerror = function (e) {
                y.trace && console.log("createError", n), a && a(n)
            };
            var c = e.inArray(n, k), u = t('script[name="' + r + '"]').length || t('script[src="' + n + '"]').length;
            return c > -1 || u ? i && i(n) : 0 > c && (document.body.appendChild(s), k.push(n)), s = null, this
        }

        function v(t) {
            var n, i = t.length;
            if ("array" === e["typeof"](t)) for (n = 0; i > n; n++) {
                var a = t[n];
                m(a)
            } else m(t)
        }

        function m(t) {
            if ("string" != typeof t) return void e.showLog(t + "的格式不正确");
            var n = e.inArray(t, T);
            if (0 > n) {
                var i = document.createElement("link") || {};
                i.href = t + (y.cache ? "" : "?t=" + (new Date).getTime()), i.setAttribute("rel", "stylesheet"), i.setAttribute("type", "text/css"), document.head.appendChild(i), i = null, T.push(t)
            }
        }

        var b, w = {cache: !0, async: !1, trace: !1, scriptSuffix: ".js"}, y = t.extend({}, w, e.config.loader, n),
            x = [], k = [], T = [], C = {baseUrl: "", modules: {}}, S = {}, O = {},
            I = {init: i, define: l, require: c, map: r, "import": p, checkLoad: h, checkDefine: f};
        return I
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.router = function (n) {
        function i(n) {
            if (n = t.extend(!0, {}, P, e.config.router, n), P = te.config = n, X && "effect" in n && J.forEach(function (e, t) {
                e.effect = n.effect
            }), !n.id) return e.showLog("id 不能为空", "bui.router.init"), !1;
            if (E = e.obj(n.id), L = bui.mask({
                appendTo: E,
                opacity: 0,
                autoClose: !1
            }), j = bui.loading({opacity: .4}), F = document.documentElement.clientWidth, N = document.documentElement.clientHeight, M = E.children(".bui-router-main"), M.length) M.css({
                width: F,
                height: N
            }); else {
                var i = x(n);
                E.html(i), M = E.children(".bui-router-main")
            }
            return q || a(n), I.call(this, "init", {currentTarget: null}), this
        }

        function a(t) {
            return window.addEventListener("load", function () {
                o()
            }), P.syncHistory && "pushState" in window.history && window.addEventListener("popstate", function (t) {
                var n = l(), i = "" == n.pid ? "main" : n.pid, a = e.inArray(i, J, "pid");
                a > -1 && d({index: -(J.length - a - 1)}), I.call(A, "popstate", {currentTarget: J[a]})
            }), this
        }

        function r(e) {
            var t = window.location.href, n = t.indexOf(P.modulePrefix), n = n > -1 ? n : 0,
                i = n > -1 ? t.substr(0, n) : t;
            s({url: P.errorPage || i}), I.call(te, "error", {currentTarget: e, status: 404})
        }

        function o(t) {
            try {
                var n = l();
                s(n.pid ? {url: n.pid, param: n.param} : {url: "main", param: n.param || {}})
            } catch (i) {
                e.showLog(i, "bui.router.loadUrl")
            }
        }

        function l(e) {
            var t = window.location.hash || window.location.search, e = 0 != e, n = t && t.indexOf("?"),
                i = n > -1 ? t && t.substr(1, n - 1) : window.location.hash.substr(1), a = i && i.indexOf(".html"),
                r = a > -1 ? i.substr(0, a) : i, o = a > -1 ? i : i + ".html", l = {};
            if (n > -1) for (var s = t && t.substr(n + 1), c = s && s.split("&"), u = 0; u < c.length; u++) {
                var d = e ? decodeURIComponent(c[u].split("=")[1]) : c[u].split("=")[1];
                l[c[u].split("=")[0]] = d
            }
            return {pid: r, url: o, param: l}
        }

        function s(n) {
            function i() {
                Y || C in B ? s() : (loader.require(C, function (t) {
                    try {
                        h.delayAnimate && o(), B[C] = t || null, U = !1
                    } catch (n) {
                        e.showLog(n, "bui.router.load")
                    }
                }), P.cache && G.add(C, O), I.call(x, "complete", {prevTarget: b, currentTarget: O}))
            }

            function a() {
                w(), R = h.replace ? v : e.obj(g);
                var t = R.find(".bui-page");
                t.length && P.autoInit && e.init({id: t}), y()
            }

            function o(t) {
                try {
                    U || Y || h.replace || h.part ? (L && L.hide(), h.progress && j && j.hide(), t && t(), R.css("zIndex", 5)) : (z && z.hide(), V && V.show(function () {
                        L && L.hide(), h.progress && j && j.hide(), t && t(), R.css("zIndex", 5)
                    }))
                } catch (n) {
                    e.showLog(n, "bui.router.doAnimate")
                }
            }

            function l(t) {
                var i = "";
                if (h.part) i = T({content: t}), v ? v.html(i) : e.showLog("id 不能为空", "router.loadPart"); else if (h.replace) {
                    var a = K.getLast();
                    v = J.length ? e.obj(a.id) : M, a.pid = C, a.url = S, a.param = p, i = T({content: t}), v.html(i).attr("data-page", C)
                } else Y || (!h.replace && K.add({
                    id: g,
                    pid: C,
                    url: S,
                    effect: n.effect || P.effect,
                    param: p
                }), i = k({id: g, content: t, pid: C}), M && M.attr("data-main", g).append(i));
                return i
            }

            function s() {
                m = ee[C] && ee[C].callback;
                var e = m && m.apply(ee[C], ee[C].dependExports);
                B[C] = e || null;
                var t = K.getLast();
                Y = !1, U = !1, I.call(x, "refresh", {prevTarget: b, currentTarget: t})
            }

            function c() {
                U && I.call(x, "pageload", {currentTarget: O}), h.part ? I.call(x, "loadpart", {
                    prevTarget: b,
                    currentTarget: O
                }) : I.call(x, "load", {prevTarget: b, currentTarget: O})
            }

            var d = {
                id: "",
                url: "",
                param: {},
                effect: "",
                delayAnimate: P.delayAnimate,
                progress: P.progress,
                replace: !1,
                part: !1
            }, h = t.extend(!0, {}, d, n), p = h.param || {};
            if (H = p, !h.url) return e.showLog("url 不能为空", "bui.router.load"), !1;
            h.id = (h.id && h.id.indexOf("#") > -1 ? h.id.substr(1) : h.id) || "";
            var g = h.id || e.guid(), v = e.obj(h.id), m = null, b = K.getLast() || null, x = u(h.url), C = x.pid,
                S = x.url, O = {id: g, pid: C, url: S, param: p, effect: n.effect || P.effect};
            if (L && L.show(), h.progress && j && j.show(), $ = C in B, J.length) {
                var E = J.length - 1;
                J[E].effect = h.effect
            }
            if (C in Z) {
                var F = G.get(C, "template");
                l(F), a(), h.delayAnimate ? (o(), s()) : o(function () {
                    s()
                }), I.call(x, "complete", {prevTarget: b, currentTarget: O})
            } else f(S, function (t, n, s) {
                if ("" == t) return e.showLog("找不到" + S, "bui.router.load"), P.errorPage && r(S), L && L.hide(), h.progress && j && j.hide(), !1;
                var u = l(t);
                return O.template = u, a(), h.delayAnimate ? (i(), void c()) : void o(function () {
                    i(), c()
                })
            }, function (t) {
                L && L.hide(), h.progress && j && j.hide(), e.showLog("请检查页面地址路径是否正确", "bui.router.load")
            });
            return this
        }

        function c(e) {
            var n = {id: "", url: "", param: {}, part: !0}, i = t.extend(!0, {}, n, e);
            s(i)
        }

        function u(e) {
            var t = "", n = e;
            Q = loader.map(), ee = Q.modules;
            var i = n.indexOf(P.pageSuffix);
            return i > -1 ? (t = n, n = t.substr(0, i), n in ee || (n = m(t) || n)) : (n = n, t = ee[n] && ee[n].template || n + P.pageSuffix || ""), {
                pid: n,
                url: t
            }
        }

        function d(n) {
            var i = this, a = t.extend(!0, {index: -1, name: "", callback: null, refresh: !1}, n),
                r = parseInt(a.index), o = J.length;
            if (r > 0) return void e.showLog("index 参数只能是负数", "bui.router.back");
            var l = K.getLast(), s = o - 1;
            if (a.name) {
                var c = parseInt(e.inArray(a.name, J, "pid"));
                r = c > 0 ? -(o - c - 1) : -1
            }
            return Math.abs(r) > s && (r = -s), o > 1 && W && (-1 > r && y(r), W = !1, V && V.hide(), z && z.show(function () {
                function t() {
                    var e = {};
                    e = a.refresh ? ee[c].callback && ee[c].callback.apply(ee[c], ee[c].exports) : B[c] || {}, a.callback && a.callback.call(i, e, s), I.call(te, "back", {
                        prevTarget: l,
                        currentTarget: s
                    }), W = !0
                }

                var n = o + r;
                b(n), K.removeNext(n), y();
                var s = w(), c = s.pid;
                e.obj(s.id).css("zIndex", 5), t()
            })), this
        }

        function f(n, i, a) {
            n ? t.ajax({
                url: n, success: function (e, t, a) {
                    a.url = n, i && i(e, t, a), I.call(te, "success", e, t, a)
                }, fail: function (e, t, n) {
                    a && a(e, t, n), I.call(te, "fail", e, t, n)
                }
            }) : e.showLog("url 不能为空", "bui.router.requestUrl")
        }

        function h() {
            Y = !0;
            var e = J.length - 1, t = J[e];
            return s({id: t.id, url: t.url, param: t.param}), this
        }

        function p(e) {
            return e = e || {}, s({url: e.url || "", param: e.param || {}, replace: !0}), this
        }

        function g() {
            return H
        }

        function v(e) {
            var t;
            return t = e ? e in B : $
        }

        function m(t) {
            for (var n in ee) try {
                var i = ee[n].template || "";
                if (i === t) return n
            } catch (a) {
                e.showLog(a.message)
            }
        }

        function b(e) {
            M.children().each(function (n, i) {
                n >= e && t(i).remove()
            })
        }

        function w() {
            var t = K.getLast(), n = t.id || "", i = t.effect || P.effect;
            return n && (V = e.toggle({
                id: n,
                effect: _[i].inRight || ""
            }), M && M.attr("data-main", n), I.call(te, "pageshow", {currentTarget: t})), t
        }

        function y(t) {
            t = t || -1;
            var n = J.length + t - 1, i = J[n], a = i && i.id || "", r = i && i.effect || P.effect;
            return a && (z = e.toggle({
                id: a,
                effect: _[r].inLeft || ""
            })), I.call(te, "pagehide", {currentTarget: i}), i
        }

        function x(e) {
            e = e || {};
            var t = "";
            return t += '<div class="bui-router-main" style="width:' + F + "px;height:" + N + 'px;">', t += "</div>"
        }

        function k(e) {
            var t = "";
            return t += '<div id="' + e.id + '" class="bui-router-item" data-page="' + e.pid + '">', t += e.content, t += "</div>"
        }

        function T(e) {
            var t = "";
            return t += e.content
        }

        function C(t, n) {
            return X = !0, e.option.call(te, t, n)
        }

        function S(t, n) {
            return e.on.apply(te, arguments), this
        }

        function O(t, n) {
            return e.off.apply(te, arguments), this
        }

        function I(t) {
            te.self = this == window || this == te ? null : this, e.trigger.apply(te, arguments)
        }

        var E, j, L, F, N, D = {
                id: "",
                progress: !1,
                syncHistory: !0,
                autoInit: !0,
                delayAnimate: !0,
                cache: !0,
                effect: "push",
                errorPage: "",
                hashPrefix: "#!",
                modulePrefix: "#",
                scriptSuffix: ".js",
                pageSuffix: ".html"
            }, P = t.extend({}, D, e.config.router, n), R = null, A = this, M = null, z = null, V = null, q = !1, H = {},
            U = !0, W = !0, Y = !1, $ = !1, X = !1, _ = {
                none: {inRight: "showIn", inLeft: "showIn"},
                fadein: {inRight: "fadeIn", inLeft: "fadeIn"},
                fadeinslide: {inRight: "fadeInRight", inLeft: "fadeInLeft"},
                slide: {inRight: "slideInRight", inLeft: "slideInLeft"},
                push: {inRight: "pushInRight", inLeft: "pushInLeft"},
                zoom: {inRight: "zoomIn", inLeft: "zoomIn"},
                cover: {inRight: "coverInRight", inLeft: "coverInLeft"},
                zoomslide: {inRight: "zoomSlideInRight", inLeft: "zoomSlideInLeft"}
            }, B = {}, J = [], K = {}, Z = {}, G = {},
            Q = loader.map({moduleName: "main", template: "pages/main/main.html", script: "pages/main/main.js"}),
            ee = Q.modules;
        K.get = function () {
            return J
        }, K.add = function (t) {
            t = t || {};
            var n = e.inArray(t.id, J, "id"), i = window.location.origin + window.location.pathname + "#" + t.pid;
            if (n > -1) J.splice(n, 1, t), P.syncHistory && "replaceState" in window.history && window.history.replaceState(t, null, i); else {
                if (J.push(t), U) return;
                P.syncHistory && "pushState" in window.history && window.history.pushState(t, null, i)
            }
            return J
        }, K.getLast = function (e) {
            var t = J.length - 1, n = J[t] || {};
            return e ? n[e] : n
        }, K.removeNext = function (e) {
            var t = J.length - e;
            J.splice(e, t);
            var n = K.getLast(), i = window.location.origin + window.location.pathname + "#" + n.pid;
            P.syncHistory && "replaceState" in window.history && window.history.replaceState(n.param, null, i)
        }, G.add = function (e, t) {
            return Z[e] = t || {}, Z[e]
        }, G.get = function (e, t) {
            if (t) {
                var n = Z[e] || {};
                return n[t]
            }
            return Z[e]
        };
        var te = {
            init: i,
            option: C,
            on: S,
            off: O,
            load: s,
            loadPart: c,
            replace: p,
            refresh: h,
            back: d,
            isLoad: v,
            getPageParams: g,
            getHistory: K.get
        };
        return te
    }, e
}(bui || {}, libs), function (e, t) {
    return e.obj = function (e) {
        var n;
        return e && "object" == typeof e ? n = t(e) : e && "string" == typeof e ? n = e.indexOf(".") < 0 && e.indexOf("#") < 0 ? t("#" + e) : t(e).eq(0) : void 0
    }, e.guid = function (e) {
        function t() {
            return (65536 * (1 + Math.random()) | 0).toString(16).substring(1)
        }

        return t() + t() + "-" + t() + "-" + t() + "-" + t() + "-" + t() + t() + t()
    }, e.setUrlParams = function (e, t, n) {
        var i, n = 0 != n, t = "object" == typeof t ? t : {}, a = "";
        for (var r in t) {
            var o = n ? encodeURIComponent(t[r]) : t[r];
            a += "&" + r + "=" + o
        }
        var l = a.substr(1);
        return i = "" == l ? e : e + "?" + l
    }, e.getUrlParams = function (e) {
        var e = 0 != e, t = window.location.search, n = {};
        if (t.indexOf("?") > -1) for (var i = t.substr(1), a = i.split("&"), r = 0; r < a.length; r++) {
            var o = e ? decodeURIComponent(a[r].split("=")[1]) : a[r].split("=")[1];
            n[a[r].split("=")[0]] = o
        }
        return n
    }, e.getUrlParam = function (e) {
        var t = window.location.search, n = new RegExp("(^|&)" + e + "=([^&]*)(&|$)", "i"), i = t.substr(1).match(n);
        return null != i ? decodeURIComponent(i[2]) : null
    }, e["typeof"] = function (e) {
        var t = Object.prototype.toString.call(e), n = t.toLowerCase();
        switch (n) {
            case"[object object]":
                t = "object";
                break;
            case"[object function]":
                t = "function";
                break;
            case"[object array]":
                t = "array";
                break;
            case"[object string]":
                t = "string";
                break;
            case"[object number]":
                t = "number";
                break;
            case"[object null]":
                t = "null";
                break;
            case"[object undefined]":
                t = "undefined";
                break;
            case"[object regexp]":
                t = "regexp";
                break;
            case"[object json]":
                t = "json"
        }
        return t
    }, e
}(bui || {}, libs), function (e, t) {
    return e.inArray = function (t, n, i) {
        var n = n || [];
        if ("string" != typeof i) {
            var a = n.indexOf(t);
            return a
        }
        for (var r in n) try {
            var o = n[r] && n[r][i];
            if (o === t) return parseInt(r)
        } catch (l) {
            e.showLog(l.message, "bui.inArray")
        }
        return -1
    }, e.compareArray = function (e, t, n) {
        var t = t || [];
        if ("string" != typeof n) {
            var i = t.indexOf(e);
            return i > -1
        }
        for (var a in t) try {
            var r = t[a] && t[a][n];
            if (r === e) return !0
        } catch (o) {
        }
        return !1
    }, e.removeArray = function (e, t, n) {
        var i = t || [];
        if ("string" == typeof n) for (var a in i) try {
            var r = i[a] && i[a][n];
            r === e && (i = i.splice(a, 1))
        } catch (o) {
        } else {
            var l = t.indexOf(e);
            l > -1 ? i.splice(l, 1) : i = t
        }
        return i
    }, e.filterArray = function (e, t, n) {
        var i = [], t = t || [];
        if ("string" == typeof n) for (var a in t) try {
            var r = t[a] && t[a][n], o = new RegExp(e);
            o.test(r) && i.push(t[a])
        } catch (l) {
        } else i = t.filter(function (t, n, i) {
            return t === e
        });
        return i
    }, e.indexArray = function (e, t, n) {
        var t = t || [], i = [];
        if ("string" == typeof n) for (var a in t) try {
            var r = t[a] && t[a][n];
            r === e && i.push(+a)
        } catch (o) {
        } else t.forEach(function (t, n, a) {
            t === e ? i.push(+n) : i
        });
        return i
    }, e.excessArray = function (e, t, n) {
        var t = t || [], i = {}, a = [];
        if ("string" == typeof n) for (var r in t) try {
            var o = t[r] && t[r][n];
            i[o] !== o && (i[o] = o, a.push(t[r]))
        } catch (l) {
        } else t.forEach(function (e, t, n) {
            i[e] !== e && (i[e] = e, a.push(e))
        });
        return a
    }, e.copyArray = function (t, n, i) {
        var a = [];
        if (form = n || 0, i = i || t && t.length, !t || "array" === e["typeof"](t)) {
            t.forEach(function (e, t) {
                a.push(e)
            });
            var r = a.splice(n, i) || [];
            return r
        }
    }, e
}(bui || {}, libs), function (e, t) {
    return e.storage = function (t) {
        function n(t, n, i) {
            var a = 1 == o ? null : d.getItem(t), r = [], l = "", s = i ? n[i] : n;
            if (null === a) r.push(n), l = JSON.stringify(r), d.setItem(t, l); else {
                var c = JSON.parse(a), f = i ? e.compareArray(s, c, i) : e.compareArray(s, c);
                f ? (e.removeArray(s, c, i), c[u](n), l = JSON.stringify(c), d.setItem(t, l)) : (c[u](n), c.length > o && 0 != o && c.pop(), l = JSON.stringify(c), d.setItem(t, l))
            }
            return this
        }

        function i(t, n, i) {
            var a, r = t && d.getItem(t) || "";
            try {
                a = r && JSON.parse(r) || []
            } catch (o) {
                e.showLog(o.name + ": " + o.message, "bui.storage.get")
            }
            if ("number" == typeof n && i) a = a && a[n] && a[n][i] || void 0; else if ("string" == typeof n) {
                var l = e.inArray(n, a, i);
                a = a && a[l]
            } else a = "number" == typeof n ? a && a[n] || void 0 : a;
            return a
        }

        function a(t, n, a) {
            if ("string" != typeof t) return void e.showLog("要删除的字段名只能是字符串", "bui.storage.remove");
            var r = i(t) || [];
            if ("number" == typeof n) {
                var o = "number" == typeof a ? a : o;
                r.splice(n, o);
                try {
                    var l = JSON.stringify(r) || "";
                    d.setItem(t, l)
                } catch (s) {
                    e.showLog(s.name + ": " + s.message, "bui.storage.remove")
                }
            } else if ("string" == typeof n) {
                var c = e.removeArray(n, r, a);
                try {
                    var l = JSON.stringify(c) || "";
                    d.setItem(t, l)
                } catch (s) {
                    e.showLog(s.name + ": " + s.message, "bui.storage.remove")
                }
            } else d.removeItem(t);
            return this
        }

        function r() {
            return d.clear(), this
        }

        var o, l, s, c = 1;
        "undefined" == typeof t ? (o = c, s = !0, l = !0) : "number" == typeof t || "string" == typeof t ? (o = 0 == parseInt(t) ? 0 : parseInt(t) || c, s = !0, l = !0) : (o = t && 0 == t.size ? 0 : t.size || c, s = !t || 0 != t.local, l = !t || 0 != t.reverse);
        var u = l ? "push" : "unshift", d = s ? localStorage : sessionStorage;
        return {get: i, set: n, remove: a, clear: r}
    }, e
}(bui || {}, libs), function (e, t) {
    return e.unit = {}, e.unit.remToPx = function (e) {
        var t = window.viewport && window.viewport.fontSize || 100, e = (parseFloat(e) * t).toFixed(2);
        return e
    }, e.unit.pxToRem = function (e) {
        var t = window.viewport && window.viewport.fontSize || 100, e = (parseFloat(e) / t).toFixed(2);
        return e
    }, e.unit.pxToRemZoom = function (e) {
        var t = 100, e = (parseFloat(e) / t).toFixed(2);
        return e
    }, e.unit.debounce = function (e, t, n) {
        var i;
        return function () {
            var a = n || this, r = arguments, o = function () {
                i = null, e.apply(a, r)
            };
            clearTimeout(i), i = setTimeout(o, t)
        }
    }, e.unit.throttle = function (e, t, n) {
        t || (t = 250);
        var i, a;
        return function () {
            var r = n || this, o = +new Date, l = arguments;
            i && i + t > o ? (clearTimeout(a), a = setTimeout(function () {
                i = o, e.apply(r, l)
            }, t)) : (i = o, e.apply(r, l))
        }
    }, e.unit.startWithCss = function (e) {
        var t = new RegExp("^\\.|^#"), n = "string" == typeof e ? t.test(e) : !1;
        return n
    }, e.unit.startWithId = function (e) {
        var t = new RegExp("^#"), n = "string" == typeof e ? t.test(e) : !1;
        return n
    }, e.unit.startWithClass = function (e) {
        var t = new RegExp("^\\."), n = "string" == typeof e ? t.test(e) : !1;
        return n
    }, e
}(bui || {}, libs), function (e, t) {
    return e.platform = function () {
        function e(e) {
            return /Windows NT/i.test(s)
        }

        function t() {
            return /Macintosh/i.test(s)
        }

        function n(e) {
            return /(Android|Linux)/i.test(s)
        }

        function i(e) {
            return /(iPhone)/i.test(s)
        }

        function a(e) {
            return /(iPad)/i.test(s)
        }

        function r(e) {
            return /(iPhone|iPad|iOS)/i.test(s)
        }

        function o(e) {
            return /(micromessenger)/i.test(s)
        }

        function l(e) {
            return /(crosswalk)/i.test(s)
        }

        var s = navigator.userAgent;
        return {isAndroid: n, isIphone: i, isIpad: a, isIos: r, isWeiXin: o, isBingotouch: l, isMac: t, isWindow: e}
    }(), e
}(bui || {}, libs), function (e, t) {
    return e.checkVersion = function (n) {
        function i(e) {
            r(e)
        }

        function a(n) {
            h.on("click", function () {
                l > g ? (x(), y({
                    title: "新版本" + c,
                    content: s,
                    buttons: n.buttons,
                    width: n.width,
                    height: n.height,
                    mask: n.mask,
                    callback: function () {
                        var i = t(this).text().trim();
                        "立即下载" == i && e.run({id: u, "native": n["native"]})
                    }
                })) : (k(), e.hint(b)), n.callback && n.callback.call(this)
            }), p = !0
        }

        function r(n) {
            e.ajax(n).done(function (i) {
                var r = i, o = parseInt(r.minVersionCode);
                u = r.downloadUrl || "", s = r.remark || "检测到新版本" + c + ",是否立即下载", l = parseInt(r.versionCode), c = r.versionName, r.isForced ? (x(), o > g ? y({
                    title: n.title,
                    content: m,
                    width: n.width,
                    height: n.height,
                    mask: n.mask,
                    autoClose: !1,
                    buttons: [{name: "立即下载", className: "primary-reverse"}],
                    callback: function () {
                        try {
                            e.run({id: u, "native": n["native"]})
                        } catch (t) {
                        }
                    }
                }) : g > o && l > g ? y({
                    title: n.title,
                    content: s,
                    buttons: n.buttons,
                    width: n.width,
                    height: n.height,
                    mask: n.mask,
                    callback: function () {
                        var i = t(this).text().trim();
                        "立即下载" == i && e.run({id: u, "native": n["native"]})
                    }
                }) : (k(), e.hint(b))) : l > g ? x() : k(), p || a(n)
            }).fail(function (t) {
                e.hint(n.tips.fail)
            })
        }

        var o = {
            id: "",
            target: "i",
            title: "版本更新",
            tips: {nowVersion: "", minVersion: "您的版本太低,需要卸载安装最新版才能正常使用!", fail: "网络超时,请检测网络再次尝试"},
            currentVersion: "",
            currentVersionCode: "",
            width: 400,
            height: 260,
            mask: !0,
            url: "",
            data: {},
            "native": !0,
            method: "GET",
            buttons: [{name: "取消", className: ""}, {name: "立即下载", className: "primary-reverse"}],
            timeout: 2e4,
            callback: null
        };
        n = n || {};
        var l, s, c, u, d = t.extend(!0, o, e.config.checkVersion, n), f = '<span class="bui-badges"></span>',
            h = e.obj(d.id), p = !1, g = parseInt(d.currentVersionCode || e.config.versionCode),
            v = d.currentVersion || e.config.version, m = d.tips.minVersion,
            b = d.tips.nowVersion || "您目前的版本" + v + ",已经是最新了 ^_^",
            w = d.target.indexOf("#") > -1 ? e.obj(d.target) : h ? h.find(d.target) : null, y = e.confirm;
        i(d);
        var x = function () {
            var e = w.find(".bui-badges").length;
            e || w.append(f)
        }, k = function () {
            w.find(".bui-badges").remove()
        }
    }, e
}(bui || {}, libs), function (e, t) {
    return e.animate = function (n) {
        function i(t) {
            return t.id ? (L = e.obj(t.id), L.css({
                "-webkit-transition": z,
                transition: z
            }), F = t.open3D, N = t.zoom, D = t.animates || [], R = P.config = t, this) : void e.showLog("animate id不能为空", "bui.animate")
        }

        function a(e) {
            var e = e, t = Math.abs(parseFloat(e));
            e = "string" == typeof e && e.indexOf("%") > -1 ? "-" + e : N ? -(t / 100) + "rem" : -t + "px";
            var n = "translateX(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function r(e) {
            var e = e, t = Math.abs(parseFloat(e));
            e = "string" == typeof e && e.indexOf("%") > -1 ? e : N ? t / 100 + "rem" : t + "px";
            var n = "translateX(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function o(e) {
            var e = e, t = Math.abs(parseFloat(e));
            e = "string" == typeof e && e.indexOf("%") > -1 ? "-" + e : N ? -(t / 100) + "rem" : -t + "px";
            var n = "translateY(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function l(e) {
            var e = e, t = Math.abs(parseFloat(e));
            e = "string" == typeof e && e.indexOf("%") > -1 ? e : N ? t / 100 + "rem" : t + "px";
            var n = "translateY(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function s(e) {
            var t = String(e), e = t.indexOf(",") > -1 ? t : e + ",1", n = "scale(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function c(e) {
            var e = String(e), t = "scaleX(" + e + ")";
            return D.push(t), A.push(t), this
        }

        function u(e) {
            var e = String(e), t = "scaleY(" + e + ")";
            return D.push(t), A.push(t), this
        }

        function d(e) {
            var t = String(e), e = t.indexOf("deg") > -1 ? t : t + "deg", n = "rotate(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function f(e) {
            var t = String(e), e = t.indexOf("deg") > -1 ? t : t + "deg", n = "rotateX(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function h(e) {
            var t = String(e), e = t.indexOf("deg") > -1 ? t : t + "deg", n = "rotateY(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function p(e) {
            var e, n = String(e), i = [];
            n.indexOf(",") > -1 ? (i = n.split(","), e = "", t.each(i, function (t, n) {
                2 > t && (e += n.indexOf("deg") > -1 ? "," + n : "," + n + "deg")
            }), e = e.substr(1)) : e = n.indexOf("deg") > -1 ? n : n + "deg,0";
            var a = "skew(" + e + ")";
            return D.push(a), A.push(a), this
        }

        function g(e) {
            var t = String(e), e = t.indexOf("deg") > -1 ? t : t + "deg", n = "skewX(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function v(e) {
            var t = String(e), e = t.indexOf("deg") > -1 ? t : t + "deg", n = "skewY(" + e + ")";
            return D.push(n), A.push(n), this
        }

        function m(e) {
            var t = String(e);
            return L.css({"-webkit-transform-origin": t, "transform-origin": t}), this
        }

        function b(e, t) {
            var n = t || "ease-out";
            return z = "number" == typeof e ? "all " + e + "ms " + n : 0 == e || "none" == e ? "none" : 1 == e ? "all 300ms " + n : e || "all 300ms " + n, L.css({
                "-webkit-transition": z,
                transition: z
            }), this
        }

        function w() {
            return D = [], A = [], M = [], V = 0, this
        }

        function y(e) {
            return q && (b(), q = !1), L.css({
                "-webkit-transform": "",
                transform: ""
            }), "none" != z && L.one("webkitTransitionEnd", function () {
                e && e.call(P, this)
            }), w(), this
        }

        function x(e) {
            var t = F ? A.join("") + "translateZ(0)" : A.join("");
            try {
                M[V] = [], M[V].push(D.join("")), D = [], V++
            } catch (n) {
            }
            return L.css({
                "-webkit-transform": t,
                transform: t
            }), "none" != z ? L.one("webkitTransitionEnd", function () {
                e && e.call(P, this)
            }) : e && e.call(P, this), this
        }

        function k(e) {
            function t(e) {
                var t = arguments, r = e[i] || [], o = e[i + 1] || [];
                n = F ? r.join("") + "translateZ(0)" : r.join(""), n = A.join("") + n.replace(/\(.*?\)/g, "(0)"), L.css({
                    "-webkit-transform": "",
                    transform: ""
                }), i++;
                try {
                    L.one("webkitTransitionEnd", function () {
                        return o && o.length ? void t.callee(a) : (i = 0, void (historyCache = []))
                    })
                } catch (l) {
                }
            }

            var n, i = 0, a = M.reverse();
            return t(a), this
        }

        function T(e, t) {
            return L.css({
                "-webkit-transform": e,
                transform: e
            }), t && "none" != b && L.one("webkitTransitionEnd", function () {
                t.call(P, this)
            }), this
        }

        function C(e) {
            return e = parseFloat(e) || 100, F = !0, L.parent().css({perspective: e + "px"}), this
        }

        function S(e, t) {
            var n = {};
            return "object" == typeof e ? (n = e, t = "") : "string" == typeof e && (n[e] = t || ""), L.css(n), this
        }

        function O(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function I(t, n) {
            return e.option.call(P, t, n)
        }

        var E = {id: "", zoom: !0, open3D: !1, animates: []};
        if ("object" == typeof n && n.id) n = n || {}; else {
            var j = n || "";
            n = {}, n.id = j
        }
        var L, F, N, D, P = {
            origin: m,
            transition: b,
            property: S,
            open3D: C,
            transform: T,
            start: x,
            stop: y,
            clear: w,
            left: a,
            right: r,
            up: o,
            down: l,
            scale: s,
            scaleX: c,
            scaleY: u,
            rotate: d,
            rotateX: f,
            rotateY: h,
            skew: p,
            skewX: g,
            skewY: v,
            reverse: k,
            widget: O,
            option: I,
            config: R,
            init: i
        }, R = P.config = t.extend(!0, {}, E, n), A = [], M = [], z = "all 300ms ease-out";
        i(R);
        var V = 0, q = !1;
        return P
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.toggle = function (n) {
        function i(t) {
            if (t = t || m, !t.id) return void e.showLog("toggle id不能为空", "bui.toggle");
            f = e.obj(t.id), m = v.config = t, g = f.attr("class") || "";
            var n = t.effect, i = t.inOrder ? e.inArray(n, b.hideInOrder) : e.inArray(n, b.hide),
                a = n && (e.inArray(n, b.show) > -1 ? e.inArray(n, b.show) : i);
            return x = !(f[0] && "none" == f[0].style.display || "none" == f.css("display")), 0 > a ? (p = b.show[0], h = t.inOrder ? b.hideInOrder[0] : b.hide[0], this) : (p = b.show[a], void (h = t.inOrder ? b.hideInOrder[a] : b.hide[a]))
        }

        function a() {
            return x
        }

        function r(t, n) {
            return w || y ? (w = !1, "function" == typeof t ? (n = t, t = p || "") : t = t || p || "", p = t, f[0] && "none" == f[0].style.display && f.css("display", "block"), f.addClass("animated " + t), "showIn" == t || "showOut" == t ? (m.revert && f.removeClass("animated " + t), n && n.call(v, this), x = !0, w = !0) : f.one("webkitAnimationEnd", function () {
                try {
                    !x && f.css("display", "block"), m.revert && f.removeClass("animated " + t), n && n.call(v, this), x = !0, w = !0
                } catch (i) {
                    e.showLog(i, "toggle show method")
                }
            }), this) : !1
        }

        function o(t, n) {
            return w || y ? (y = !1, "function" == typeof t ? (n = t, t = h || "") : t = t || h || "", f.css("display", "block").addClass("animated " + t), h = t, "showIn" == t || "showOut" == t ? (f.css("display", "none"), m.revert && f.removeClass("animated " + t), n && n.call(v, this), x = !1, y = !0) : f.one("webkitAnimationEnd", function () {
                try {
                    f.css("display", "none"), m.revert && f.removeClass("animated " + t), n && n.call(v, this), x = !1, y = !0
                } catch (i) {
                    e.showLog(i, "toggle hide method")
                }
            }), this) : void 0
        }

        function l() {
            return f.remove(), this
        }

        function s(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function c(t, n) {
            return e.option.call(v, t, n)
        }

        var u = {id: "", effect: "fadeIn", revert: !0, inOrder: !1};
        if ("string" == typeof n) {
            var d = n || "";
            n = {}, n.id = d
        }
        var f, h, p, g, v = {show: r, hide: o, remove: l, isShow: a, widget: s, option: c, config: m, init: i},
            m = v.config = t.extend(!0, {}, u, n), b = {
                show: ["fadeIn", "fadeInLeft", "fadeInRight", "fadeInDown", "fadeInUp", "fadeInLeftBig", "fadeInRightBig", "fadeInUpBig", "fadeInDownBig", "zoomIn", "bounceIn", "rotateIn", "rollIn", "flipInX", "flipInY", "lightSpeedIn", "showIn", "slideInRight", "slideInLeft", "coverInLeft", "coverInRight", "zoomSlideInLeft", "zoomSlideInRight", "pushInLeft", "pushInRight"],
                hide: ["fadeOut", "fadeOutLeft", "fadeOutRight", "fadeOutUp", "fadeOutDown", "fadeOutLeftBig", "fadeOutRightBig", "fadeOutDownBig", "fadeOutUpBig", "zoomOut", "bounceOut", "rotateOut", "rollOut", "flipOutX", "flipOutY", "lightSpeedOut", "showOut", "slideOutRight", "slideOutLeft", "coverOutLeft", "coverOutRight", "zoomSlideOutLeft", "zoomSlideOutRight", "pushOutLeft", "pushOutRight"],
                hideInOrder: ["fadeOut", "fadeOutRight", "fadeOutLeft", "fadeOutDown", "fadeOutUp", "fadeOutRightBig", "fadeOutLeftBig", "fadeOutUpBig", "fadeOutDownBig", "zoomOut", "bounceOut", "rotateOut", "rollOut", "flipOutX", "flipOutY", "lightSpeedOut", "showOut", "slideOutLeft", "slideOutRight", "coverOutRight", "coverOutLeft", "zoomSlideOutRight", "zoomSlideOutLeft", "pushOutRight", "pushOutLeft"]
            }, w = !0, y = !0, x = !1;
        return i(m), v
    }, e
}(bui || {}, libs), function (e, t) {
    return e.mask = function (n) {
        var i = [];
        return function (n) {
            function a(e) {
                var n = t.extend(!0, T, e);
                return T = k.config = n, w = S.css("position"), n.autoTrigger && l(n),
                    this
            }

            function r(e) {
                var n = t.extend(!0, T, e), a = function (e) {
                    var t = this;
                    if (n.appendTo) n.callback && n.callback.call(t, e); else {
                        var a = i[i.length - 1];
                        a && a.callback && a.callback.call(this, e)
                    }
                    e.stopPropagation()
                };
                I.on("click.bui", a), E = !0
            }

            function o(t) {
                var n = t, i = n.background ? n.background : "rgba(0,0,0," + n.opacity + ")", a = "";
                return a += '<div class="' + e.prefix("mask") + '" style="background:' + i + ";z-index:" + n.zIndex + '"></div>'
            }

            function l(e) {
                var n = t.extend(!0, T, e), i = o(n);
                return I = S.children(".bui-mask"), "" == n.appendTo && c(n), I.length < 1 ? (S.append(i).css("position", "relative"), I = S.children(".bui-mask")) : I.css("display", "block"), y = !0, O = !0, b.call(this, "show"), E || r(n), this
            }

            function s() {
                return I = S.children(".bui-mask"), T.appendTo ? (I && I.remove(), I = null, S.css("position", w || "static"), y = !1) : (u(), i.length < 1 && I && I.length && (I && I.remove(), I = null, O = !1)), E = !1, b.call(this, "hide"), this
            }

            function c(t) {
                e.compareArray(j, i, "id") || i.push({id: j, opacity: t.opacity, callback: t.callback})
            }

            function u(e) {
                i.pop()
            }

            function d(e) {
                var n = t.extend(!0, T, e);
                return I = S.children(".bui-mask"), I && I.length ? (I.css("display", "block"), S.css("position", "relative"), y = !0, O = !0, "" == n.appendTo && c(n)) : l(n), b.call(this, "show"), this
            }

            function f() {
                return I = S.children(".bui-mask"), T.appendTo ? (I.css("display", "none"), S.css("position", "relative"), y = !1) : (u(), i.length < 1 && I && I.length && (I.css("display", "none"), O = !1)), b.call(this, "hide"), this
            }

            function h() {
                return T.appendTo ? y : O
            }

            function p(t) {
                var n = {};
                return e.widget.call(n, t)
            }

            function g(t, n) {
                return e.option.call(k, t, n)
            }

            function v(t, n) {
                return e.on.apply(k, arguments), this
            }

            function m(t, n) {
                return e.off.apply(k, arguments), this
            }

            function b(t) {
                k.self = this == window || this == k ? null : this, e.trigger.apply(k, arguments)
            }

            var w, y, x = {
                    appendTo: "",
                    opacity: .6,
                    background: "",
                    zIndex: 100,
                    autoTrigger: !1,
                    autoClose: !1,
                    callback: null
                }, k = {
                    handle: {},
                    on: v,
                    off: m,
                    add: l,
                    hide: f,
                    show: d,
                    isShow: h,
                    remove: s,
                    widget: p,
                    option: g,
                    config: T,
                    init: a
                }, T = k.config = t.extend(!0, {}, x, e.config.mask, n), C = t("body"), S = T.appendTo ? t(T.appendTo) : C,
                O = !1, I = S.children(".bui-mask"), E = !1, j = e.guid();
            return a(T), k
        }
    }(), e
}(bui || {}, libs), function (e, t) {
    return e.loading = function () {
        var n = [];
        return function (i) {
            function a(n) {
                var i = t.extend(!0, I, n);
                j = n.appendTo ? t(n.appendTo) : E, L = e.guid(), F = j.children(".bui-loading"), I = O.config = i, i.autoTrigger && l(i);
                var a = i.callback;
                return i.callback = function () {
                    i.autoClose && d(), a && a.call(this)
                }, I.callback = i.callback, C = i.mask && e.mask(i), this
            }

            function r(e) {
                F = j.children(".bui-loading");
                var t = function (t) {
                    if (e.appendTo) e.callback && e.callback.call(this, t); else {
                        var i = n[n.length - 1];
                        i && i.callback && i.callback.call(this, t)
                    }
                    t.stopPropagation()
                };
                return j.on("click.bui", ".bui-loading", t), N = !0, this
            }

            function o(t) {
                t = t || {};
                var n = t.text, i = j.width(),
                    a = n && "block" == t.display ? parseInt(t.height) + 30 : parseInt(t.height), r = -(i / 2),
                    o = -(a / 2), l = "block" == t.display ? "" : e.prefix("loading-inline"), s = "";
                s += '<div id="' + L + '" class="' + e.prefix("loading") + " " + l + '" style="width:' + i + "px;height:" + a + "px;line-height:" + a + "px;margin-left:" + r + "px;margin-top:" + o + "px;" + (t.zIndex ? "z-index:" + t.zIndex : "") + '" >', t.onlyText || (s += '<div class="' + e.prefix("loading-cell") + '" style="width:' + parseFloat(t.width) + "px;height:" + parseFloat(t.height) + 'px;"></div>'), n && (s += '<div class="' + e.prefix("loading-text") + '">' + t.text + "</div>"), s += "</div>";
                var c = t && t.template ? t.template.call(this, t) : s;
                return c
            }

            function l(e) {
                var n = t.extend(!0, I, e);
                if (F = j.children(".bui-loading"), T = F.children(".bui-loading-cell"), F && F.hasClass("bui-loading-pause")) F && F.removeClass("bui-loading-pause"), x.call(this, "start"); else {
                    "" == n.appendTo && g(n), F.length && F.remove();
                    var i = o(n);
                    j.append(i), C && C.add(n), x.call(this, "show")
                }
                return n.timeout && (D && clearTimeout(D), D = setTimeout(function () {
                    d()
                }, n.timeout)), N || r(n), this
            }

            function s(e) {
                k = F && F.children(".bui-loading-text");
                var t;
                return "undefined" == typeof e ? t = k && k.text() : (k && k.text(e), this)
            }

            function c() {
                T = F && F.children(".bui-loading-cell"), T && T.css("display", "inline-block"), F && F.removeClass("bui-loading-pause")
            }

            function u() {
                T = F && F.children(".bui-loading-cell"), T && T.css("display", "none"), F && F.addClass("bui-loading-pause")
            }

            function d() {
                return F = j.children(".bui-loading"), I.appendTo ? (F && F.remove(), F = null, C && C.remove()) : (v(), C && C.remove(), n.length < 1 && F && F.length && (F && F.remove(), F = null)), N = !1, x.call(this, "remove"), x.call(this, "hide"), this
            }

            function f() {
                return F = j.children(".bui-loading"), F && F.length && (F.addClass("bui-loading-pause"), x.call(this, "pause")), this
            }

            function h(e) {
                var n = t.extend(!0, I, e);
                return F = j.children(".bui-loading"), F && F.length ? (s(n.text), F.css("display", "block"), C && C.show(), "" == n.appendTo && g(I), x.call(this, "show")) : l(n), I.timeout && (D && clearTimeout(D), D = setTimeout(function (e) {
                    p()
                }, I.timeout)), this
            }

            function p() {
                return F = j.children(".bui-loading"), I.appendTo ? (F.css("display", "none"), C && C.hide()) : (v(), n.length < 1 && F && F.length && (F.css("display", "none"), C && C.hide())), x.call(this, "hide"), this
            }

            function g(t) {
                !e.compareArray(L, n, "id") && t.callback && n.push({id: L, callback: t.callback})
            }

            function v() {
                n.pop()
            }

            function m(t) {
                var n = {mask: C || {}};
                return e.widget.call(n, t)
            }

            function b(t, n) {
                return e.option.call(O, t, n)
            }

            function w(t, n) {
                return e.on.apply(O, arguments), this
            }

            function y(t, n) {
                return e.off.apply(O, arguments), this
            }

            function x(t) {
                O.self = this == window || this == O ? null : this, e.trigger.apply(O, arguments)
            }

            var k, T, C, S = {
                    appendTo: "",
                    width: 20,
                    height: 20,
                    text: "正在加载...",
                    onlyText: !1,
                    mask: !0,
                    zIndex: "",
                    autoTrigger: !1,
                    autoClose: !0,
                    timeout: 0,
                    display: "inline",
                    template: null,
                    callback: null
                }, O = {
                    handle: {},
                    on: w,
                    off: y,
                    start: l,
                    stop: d,
                    pause: f,
                    text: s,
                    showRing: c,
                    hideRing: u,
                    show: h,
                    hide: p,
                    widget: m,
                    option: b,
                    config: I,
                    init: a
                }, I = O.config = t.extend(!0, {}, S, e.config.loading, i), E = t("body"), j = null, L = "", F = null,
                N = !1, D = null;
            return a(I), O
        }
    }(), e
}(bui || {}, libs), function (e, t) {
    return e.slide = function (n) {
        function i(n) {
            var i = t.extend(!0, ne, n);
            return i.id ? (D = e.obj(i.id), ne = te.config = i, W = i.direction, i.height = parseFloat(i.height), i.width = parseFloat(i.width), J = document.documentElement.clientWidth, K = document.documentElement.clientHeight, P = 0 == i.menu.indexOf("#") ? e.obj(i.menu) : D.find(i.menu).eq(0), R = P.children(), A = D.find(i.children).eq(0), M = A.parent(), z = A.children(), a(i), o(), Z = i.autoplay, Z && p(), re || r(), ae = ae || i.index, i.index > 0 ? h(i.index, "none") : ae > 0 ? h(ae) : y(ae), i.autoload && C(ae), this) : void e.hint("slide id不能为空")
        }

        function a(e) {
            var n = D.parents("main"), i = D[0] && D[0].offsetTop || 0, a = t(e.header),
                r = a.length > 1 ? a.eq(a.length - 1).height() : a.height(), o = t(e.footer),
                l = o.length > 1 ? o.eq(o.length - 1).height() : o.height();
            X = n.length ? n.height() - i : K - (r || 0) - (l || 0) - i, _ = 0 == e.height ? X : e.height;
            var s = "static" == P.parent().css("position") ? P.css("position") : P.parent().css("position");
            B = D.find(e.menu).length ? "absolute" == s || "fixed" == s ? _ : _ - P.height() : _, $ = e.fullscreen ? K : 0 == e.height ? B : e.height, Y = e.fullscreen ? J : e.width || J, V = z.length, H = Y * V, U = $ * V
        }

        function r() {
            var e = function (e) {
                var n = t(this).hasClass("active"), i = t(this).index();
                n || (ne.animate ? h(i) : h(i, "none"), y(i), Z && p()), e.stopPropagation()
            };
            0 == ne.menu.indexOf("#") ? P.on("click.bui", "li", e) : D.on("click.bui", ne.menu + " li", e), D.on("click.bui", ne.prev, b), D.on("click.bui", ne.next, w);
            var n = ne.children + " " + ne.item;
            D.on("click.bui", n, function (e) {
                N.call(this, "click", e), ne.callback && ne.callback.call(this, e, te)
            }), k(), ne.swipe || x(), re = !0
        }

        function o() {
            ce = {
                x: {swipeDir: "swipeleft", swipeDir2: "swiperight", width: Y},
                y: {swipeDir: "swipeup", swipeDir2: "swipedown", width: $}
            }, G = {
                x: {
                    parentInitKey: "width",
                    parentInitValue: H,
                    boxCss: "display:-webkit-box;display:box;-webkit-box-align: start;-webkit-box-pack: center;width:100%;",
                    boxItemCSS: "-webkit-box-flex:1;box-flex:1;width:" + Y + "px;height:" + $ + "px;"
                },
                y: {
                    parentInitKey: "height",
                    parentInitValue: U,
                    box: "display:-webkit-box;display:box;-webkit-box-align: start;-webkit-box-pack: center;width:100%;-webkit-box-orient: vertical;box-orient: vertical;",
                    boxItemCSS: "-webkit-box-flex:1;box-flex:1;width:" + Y + "px;height:" + $ + "px;"
                }
            }, A.parent()[G[W].parentInitKey](G[W].parentInitValue);
            var e, n = z.length;
            for (e = 0; n > e; e++) Q = Boolean(z.eq(e).attr("data-scroll")) || ne.scroll, G[W].boxItemCSS = G[W].boxItemCSS + (Q ? "overflow:auto;" : "overflow:hidden;"), z[e].style.cssText = G[W].boxItemCSS;
            try {
                A[0].style.cssText = G[W].boxCss
            } catch (i) {
                console.log("找不到$children[0],请检查下初始化是否在bui.ready里面,或者children参数是否正确.")
            }
            var a = ne.zoom ? _ / 100 + "rem" : _ + "px", r = ne.zoom ? B / 100 + "rem" : B + "px";
            ne.zoom ? Y / 100 + "rem" : Y + "px";
            if (ne.fullscreen ? (t("main").css({position: "static"}), D.addClass("bui-slide-fullscreen").css({
                position: "absolute",
                top: 0,
                left: 0,
                right: 0,
                bottom: 0,
                "z-index": 10,
                overflow: "hidden",
                width: Y,
                height: K
            }), z.addClass(ne.alignClassName || "bui-box-center").css("height", K)) : (D.css({
                position: "relative",
                overflow: "hidden",
                width: Y,
                height: a
            }), z.addClass(ne.alignClassName).height(r)), ne.autopage) {
                var o = z.length, l = A.find(".active").index() + 1, s = T(o, l);
                D.children(".bui-slide-head").remove(), D.append(s), R = D.find(ne.menu).eq(0).children()
            }
        }

        function l(e) {
            var t = e.originalEvent && e.originalEvent.targetTouches || e.targetTouches, n = de ? t[0] : e;
            return ie.x1 = n.pageX, ie.y1 = n.pageY, ie.direction = "", ve = -ae * Y, me = -ae * $, t.length > 1 || e.scale && 1 !== e.scale ? void d("x" == W ? ve : me) : (Z && (g(), Z = !0), N.call(this, "touchstart", e, ie), ne.onStart && ne.onStart.call(this, e, ie, te), void (pe = !0))
        }

        function s(n) {
            var i = n.originalEvent && n.originalEvent.targetTouches || n.targetTouches;
            if (i.length > 1 || n.scale && 1 !== n.scale) return void d("x" == W ? ve : me);
            if (pe) {
                var a = de ? i[0] : n;
                ie.x2 = a.pageX, ie.y2 = a.pageY, ie.direction || (ie.direction = e.swipeDirection(ie.x1, ie.x2, ie.y1, ie.y2)), "swipeleft" !== ie.direction && "swiperight" !== ie.direction || (n.preventDefault(), n.stopPropagation()), N.call(this, "touchmove", n, ie);
                try {
                    if ("y" == W && ne.scroll) {
                        var r = t(n.target).closest(".active"), o = r[0].scrollTop || 0, l = r[0].scrollHeight || 0,
                            s = r.height() || 0;
                        if ("swipedown" === ie.direction && o > 1) return void (ge = !1);
                        if ("swipeup" === ie.direction && l - o - s >= 2) return void (ge = !1)
                    }
                } catch (n) {
                }
                deltaX = ie.x2 - ie.x1, deltaY = ie.y2 - ie.y1, ce.x.move = ve + deltaX, ce.x.absDelta = Math.abs(deltaX), ce.y.move = me + deltaY, ce.y.absDelta = Math.abs(deltaY), ie.direction !== ce[W].swipeDir && ie.direction !== ce[W].swipeDir2 || (ne.delay && ce[W].absDelta > ne.distance && d(ce[W].move, "none"), ne.delay || (ne.bufferEffect ? d(ce[W].move, "none") : 0 == ae && V > 1 && ("swipeleft" == ie.direction || "swipeup" == ie.direction) ? d(ce[W].move, "none") : ae == V - 1 && V > 1 && ("swiperight" == ie.direction || "swipedown" == ie.direction) ? d(ce[W].move, "none") : ae > 0 && V - 1 > ae && V > 1 && d(ce[W].move, "none"), n.preventDefault()), ne.onMove && ne.onMove.call(this, n, ie, te)), ge = !0
            }
        }

        function c(e) {
            N.call(this, "touchend", e, ie), ge && (deltaX = ie.x2 - ie.x1, deltaY = ie.y2 - ie.y1, ce.x.delta = ve, ce.x.absDelta = Math.abs(deltaX), ce.y.delta = me, ce.y.absDelta = Math.abs(deltaY), ce[W].absDelta > ne.distance ? (u.call(this, ie, ce), ne.onEnd && ne.onEnd.call(this, e, ie, te)) : ce[W].absDelta < ne.distance && d(ce[W].delta), Z && p(), "swipeleft" != ie.direction && "swiperight" != ie.direction || e.stopPropagation(), fe += ie.y2 - ie.y1, he += ie.x2 - ie.x1, ie.lastX = he, ie.lastY = fe, ie = {
                x1: 0,
                x2: 0,
                y1: 0,
                y2: 0,
                direction: ""
            }, pe = !1, ge = !1)
        }

        function u(e, t) {
            ae = A.children(".active").index();
            var i;
            e.direction == t[W].swipeDir ? ae >= z.length - 1 ? (i = ae, t[W].delta = -i * t[W].width, d(t[W].delta), ae = i, y(i), N.call(this, "last", i)) : (i = ae + 1, t[W].delta = -i * t[W].width, d(t[W].delta), ae = i, y(i), N.call(this, "next", i)) : e.direction == t[W].swipeDir2 && (ae > 0 ? (i = ae - 1, t[W].delta = -i * t[W].width, d(t[W].delta), ae = i, y(i), N.call(this, "prev", i)) : (i = ae, t[W].delta = -i * t[W].width, d(t[W].delta), ae = i, y(i), N.call(this, "first", i))), n.autoload && C(ae);
            var a = z.eq(ae);
            N.call(a, "to", i)
        }

        function d(e, t) {
            var n = ne.transition, t = t || "all " + n + "ms", e = e || 0;
            switch (W) {
                case"x":
                    f(e + "px", 0, t, M);
                    break;
                case"y":
                    f(0, e + "px", t, M)
            }
            return this
        }

        function f(e, t, n, i) {
            var n, i = i || D, e = e || 0, t = t || 0, a = e, r = t, o = String(e).indexOf("%") > -1 ? String(e) : a,
                l = String(t).indexOf("%") > -1 ? String(t) : r;
            n = "number" == typeof n ? "all " + n + "ms" : n || "all 300ms";
            try {
                i.css({
                    "-webkit-transition": n,
                    transition: n,
                    "-webkit-transform": "translate(" + o + "," + l + ")",
                    transform: "translate(" + o + "," + l + ")"
                }), i.one("webkitTransitionEnd", function () {
                    i.css({"-webkit-transition": "none", transition: "none"})
                })
            } catch (s) {
                console.log(s.message)
            }
        }

        function h(e, t) {
            var e = parseInt(e), i = {x: {transform: -e * parseFloat(Y)}, y: {transform: -e * parseFloat($)}};
            if (e >= z.length || 0 > e) return !1;
            d(i[W].transform, t), ae = e, y(e), Z && p(), n.autoload && C(ae);
            var a = z.eq(ae);
            return N.call(a, "to", e), this
        }

        function p(e) {
            var e = e || ne.interval;
            g(), Z = !0;
            var t = ae;
            q = setInterval(function (e) {
                t >= 0 && V - 1 > t ? t += 1 : t = 0, h(t)
            }, e), N.call(this, "play")
        }

        function g(e) {
            if (q) try {
                window.clearInterval(q), Z = !1, N.call(this, "stop")
            } catch (t) {
            }
            return this
        }

        function v(e) {
            p(e)
        }

        function m() {
            return ae
        }

        function b() {
            var e = ae - 1;
            return N.call(this, "prev", e), h(e), this
        }

        function w() {
            var e = ae + 1;
            return N.call(this, "next", e), h(e), this
        }

        function y(e) {
            e = e || 0, z.removeClass("active"), z.eq(e).addClass("active"), R.removeClass("active"), R.eq(e).addClass("active")
        }

        function x() {
            return D.off("touchstart", l).off("touchmove", s).off("touchend", c).off("touchcancel"), N.call(this, "lock"), this
        }

        function k(e) {
            return D.on("touchstart", l).on("touchmove", s).on("touchend", c).on("touchcancel", function () {
                d("x" == W ? ve : me)
            }), N.call(this, "unlock"), this
        }

        function T(e, t) {
            var n, i = "", t = t || 1;
            for (i += '<div class="bui-slide-head">', i += "<ul >", n = 1; n < Number(e) + 1; n++) i += "<li " + (n == t ? 'class="active"' : "") + ">" + n + "</li>";
            return i += "</ul >", i += "</div >"
        }

        function C(e) {
            var n = z.eq(e), i = R.eq(e), a = i.attr("href") || "";
            return bui.compareArray(e, le) ? !1 : void (a && t.ajax({
                url: a, success: function (t, i) {
                    n.html(t), le.push(e), N.call(n, "load", t, i)
                }, error: function (e, t) {
                    N.call(n, "loadfail", e, t)
                }
            }))
        }

        function S(t) {
            var n, i = e.guid(), t = t || 1, a = "";
            for (n = 0; t > n; n++) a += '<li id="' + i + '" style="-webkit-box-flex:1;box-flex:1;width:' + Y + "px;height:" + $ + 'px;"></li>';
            A.append(a), z = A.children();
            var r = Y * z.length;
            V = z.length, M.width(r)
        }

        function O(n) {
            var i = {id: null, url: "", preload: !1, param: {}, success: null, fail: null}, a = t.extend(!0, {}, i, n),
                r = a.url || "", o = null, l = z.length ? ae + 1 : 0;
            if (a.id) o = e.obj(a.id); else {
                var s = z.eq(l);
                s.length ? o = s : (S(), z = A.children(), o = z.eq(l))
            }
            if (r) if (ae = l, se[l] = a.param, r in oe) {
                var c = "cache";
                bui.compareArray(l, le) || (le.push(l), o.html(oe[r]), a.success && a.success.call(o, oe[r], c), N.call(o, "load", oe[r], c)), a.preload || h(l)
            } else t.ajax({
                url: r, success: function (e, t) {
                    e ? (oe[r] = e, bui.compareArray(l, le) || (le.push(l), o.html(oe[r]), a.success && a.success.call(o, oe[r], t), N.call(o, "load", e, t)), a.preload || h(l)) : (a.fail && a.fail.call(o, e, t), N.call(o, "loadfail", e, t))
                }, error: function (e, t) {
                    a.fail && a.fail.call(o, e, t), N.call(o, "loadfail", e, t)
                }
            });
            return this
        }

        function I(e) {
            var e = "number" == typeof e ? e : ae;
            return se[e] || {}
        }

        function E(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function j(t, n) {
            return e.option.call(te, t, n)
        }

        function L(t, n) {
            return e.on.apply(te, arguments), this
        }

        function F(t, n) {
            return e.off.apply(te, arguments), this
        }

        function N(t) {
            te.self = this == window || this == te ? null : this, e.trigger.apply(te, arguments)
        }

        var D, P, R, A, M, z, V, q, H, U, W, Y, $, X, _, B, J, K, Z, G, Q, ee = {
                id: "",
                menu: ".bui-slide-head ul",
                children: ".bui-slide-main ul",
                header: "header",
                footer: "footer",
                item: "li",
                prev: ".bui-slide-prev",
                next: ".bui-slide-next",
                alignClassName: "",
                width: 0,
                height: 0,
                zoom: !1,
                transition: 200,
                interval: 5e3,
                swipe: !0,
                animate: !0,
                delay: !1,
                bufferEffect: !1,
                distance: 80,
                direction: "x",
                autoplay: !1,
                scroll: !1,
                index: 0,
                fullscreen: !1,
                autopage: !1,
                autoload: !1,
                callback: null,
                onStart: null,
                onMove: null,
                onEnd: null
            }, te = {
                handle: {},
                on: L,
                off: F,
                to: h,
                load: O,
                getPageParams: I,
                prev: b,
                next: w,
                stop: g,
                start: v,
                lock: x,
                index: m,
                unlock: k,
                widget: E,
                option: j,
                config: ne,
                init: i
            }, ne = te.config = t.extend(!0, {}, ee, e.config.slide, n), ie = {}, ae = 0, re = !1, oe = {}, le = [],
            se = [], ce = {x: {}, y: {}}, ue = /hp-tablet/gi.test(navigator.appVersion),
            de = "ontouchstart" in window && !ue, W = "", fe = 0, he = 0, pe = !1, ge = !1,
            ie = {x1: 0, x2: 0, y1: 0, y2: 0, direction: ""};
        i(ne);
        var ve, me;
        return te
    }, e
}(bui || {}, libs), function (e, t) {
    return e.swipe = function () {
        var n = null, i = null;
        return function (a) {
            function r(i) {
                var a = t.extend(!0, J, i);
                return a.id ? (A = e.obj(a.id), q = a.width ? a.width : ye.clientWidth, H = a.height ? a.height : ye.clientHeight, M = A.children(a.handle), z = G ? A.children() : A, U = z.children(a.swipeleft), W = z.children(a.swiperight), Y = z.children(a.swipeup), $ = z.children(a.swipedown), X = parseFloat(a.movingDistance), V = X, s(), Q || (o(a), Q = !0), n && n.close(), ue || j(), this) : void e.showLog("swipe id不能为空", "bui.swipe.init")
            }

            function o(e) {
                z.css({
                    width: q,
                    position: "relative",
                    overflow: "hidden"
                }), !G && z.css({height: H}), M.css({position: "relative", "z-index": 10});
                try {
                    var t = U.attr("data-moving") || X, n = W.attr("data-moving") || X, i = Y.attr("data-moving") || X,
                        a = $.attr("data-moving") || X, r = l(t), o = l(n), s = l(i), c = l(a);
                    te && U.css({width: r}), ee && W.css({width: o}), ie && $.css({height: s}), ne && Y.css({height: c})
                } catch (u) {
                }
            }

            function l(e) {
                var t = J.zoom ? e / 100 + "rem" : e + "px";
                return t
            }

            function s() {
                "x" == Z ? (ee = !!W.length, te = !!U.length) : "y" == Z ? (ie = !!$.length, ne = !!Y.length) : "xy" == Z && (ie = !!$.length, ne = !!Y.length, te = !!U.length, ee = !!W.length)
            }

            function c(e) {
                var n = e.originalEvent && e.originalEvent.targetTouches || e.targetTouches;
                if (n.length > 1 || e.scale && 1 !== e.scale) return void (ve = !1);
                var i = ge ? n[0] : e;
                K.id = J.id, K.x1 = i.pageX, K.y1 = i.pageY, K.direction = "", $hasHandle = t(e.target).closest(J.handle);
                $hasHandle.height();
                if (R.call(this, "touchstart", e, K), G && !he) {
                    M = $hasHandle, z = M.parent(), U = z.children(J.swipeleft), W = z.children(J.swiperight), Y = z.children(J.swipeup), $ = z.children(J.swipedown), s();
                    z.index();
                    o(J), (0 == J.height || "" == z[0].style.height) && z.height($hasHandle.height())
                }
                if (K.movingleft = parseInt(U.attr("data-moving") || X), K.movingright = parseInt(W.attr("data-moving") || X), K.movingup = parseInt(Y.attr("data-moving") || X), K.movingdown = parseInt($.attr("data-moving") || X), $hasHandle.length) {
                    var a = !1;
                    switch (Z) {
                        case"x":
                            a = !(!te && !ee);
                            break;
                        case"y":
                            a = !(!ne && !ie);
                            break;
                        case"xy":
                            a = !!(te || ee || ne || ie)
                    }
                }
                ve = void 0 == a || 1 == a
            }

            function u(a) {
                var r = a.originalEvent && a.originalEvent.targetTouches || a.targetTouches;
                if (r.length > 1 || a.scale && 1 !== a.scale) return void T();
                var o = ge ? r[0] : a;
                if (K.x2 = o.pageX, K.y2 = o.pageY, R.call(this, "touchmove", a, K), n && a.stopPropagation(), ve) {
                    K.direction || (K.direction = e.swipeDirection(K.x1, K.x2, K.y1, K.y2)), "swipeleft" !== K.direction && "swiperight" !== K.direction || a.preventDefault();
                    try {
                        if ("swipeup" === K.direction || "swipedown" === K.direction) {
                            var l = A[0].scrollTop || 0, s = (A[0].scrollHeight || 0, $hasHandle[0].scrollTop || 0),
                                c = ($hasHandle[0].scrollHeight || 0, t(a.target)[0].scrollTop || 0),
                                u = t(a.target).height() || 0, d = t(a.target)[0].scrollHeight || 0, p = !1, g = !1;
                            0 == l && 0 == s && 0 == c && (p = !0), 2 >= d - c - u && (g = !0)
                        }
                    } catch (a) {
                    }
                    var v = "swiperight" == K.direction || "swipeleft" == K.direction ? K.x2 - K.x1 : K.y2 - K.y1,
                        m = 0;
                    K.deltax = he ? Math.abs(v) : Math.abs(v) + be, !ee || "swiperight" != K.direction || re || he || i ? !p || !ie || "swipedown" != K.direction || oe || he || i ? !te || "swipeleft" != K.direction || ae || he || i ? !g || !ne || "swipeup" != K.direction || le || he || i ? "swipeleft" == K.direction && re ? (V = K.movingright, m = f(K, K.movingright), ce && L(-K.deltax, 0, "none", i || W), se && L(-m, 0, "none", M), R.call(this, "movingleft", a, K), me = !0, a.stopPropagation()) : "swipeup" == K.direction && oe ? (V = K.movingdown, m = f(K, K.movingdown), ce && L(0, -K.deltax, "none", i || $), se && L(0, -m, "none", M), R.call(this, "movingup", a, K), me = !0, a.preventDefault(), a.stopPropagation()) : "swiperight" == K.direction && ae ? (V = K.movingleft, m = f(K, K.movingleft), ce && L(K.deltax, 0, "none", i || U), se && L(m, 0, "none", M), R.call(this, "movingright", a, K), me = !0, a.stopPropagation()) : "swipedown" == K.direction && le && (V = K.movingup, m = f(K, K.movingleft), ce && L(0, K.deltax, "none", i || Y), se && L(0, m, "none", M), R.call(this, "movingdown", a, K), me = !0, a.preventDefault(), a.stopPropagation()) : (V = K.movingup, m = h(K, K.movingup), ce && L(0, m, "none", Y), se && L(0, -K.deltax, "none", M), R.call(this, "movingup", a, K), me = !0, a.preventDefault(), a.stopPropagation()) : (V = K.movingleft, m = h(K, K.movingleft), ce && L(m, 0, "none", U), se && L(-K.deltax, 0, "none", M), R.call(this, "movingleft", a, K), me = !0, a.stopPropagation()) : (V = K.movingdown, m = f(K, K.movingdown), ce && L(0, m, "none", $), se && L(0, K.deltax, "none", M), R.call(this, "movingdown", a, K), me = !0, a.preventDefault(), a.stopPropagation()) : (V = K.movingright, m = f(K, K.movingright), ce && L(m, 0, "none", W), se && L(K.deltax, 0, "none", M), R.call(this, "movingright", a, K), me = !0, a.stopPropagation())
                }
            }

            function d(e) {
                if (R.call(this, "touchend", e, K), me) {
                    var t = "swiperight" == K.direction || "swipeleft" == K.direction ? Math.abs(K.x2 - K.x1) : Math.abs(K.y2 - K.y1);
                    ee && "swiperight" == K.direction && t > J.distance && !re && !he ? (g(), R.call(this, K.direction, e, K), R.call(this, "open", K.direction)) : te && "swipeleft" == K.direction && t > J.distance && !ae && !he ? (p(), R.call(this, K.direction, e, K), R.call(this, "open", K.direction)) : ne && "swipeup" == K.direction && t > J.distance && !le && !he ? (v(), R.call(this, K.direction, e, K), R.call(this, "open", K.direction)) : ie && "swipedown" == K.direction && t > J.distance && !oe && !he ? (m(), R.call(this, K.direction, e, K), R.call(this, "open", K.direction)) : he && t < J.distance ? (te && ae && p(), ee && re && g(), ne && le && v(), ie && oe && m(), R.call(this, K.direction, e, K), J.alwaysTrigger && R.call(this, "open", K.direction)) : he && t > J.distance ? (te && ae && w(), ee && re && b(), ne && le && y(), ie && oe && x(), R.call(this, K.direction, e, K), R.call(this, "close", K.direction)) : !he && t < J.distance && (te && !ae && w(), ee && !re && b(), ne && !le && y(), ie && !oe && x(), J.alwaysTrigger && R.call(this, "close", K.direction), R.call(this, K.direction, e, K)), ve = !1, me = !1, e.stopPropagation()
                }
            }

            function f(e, t) {
                var n = -t + e.deltax;
                return n = n > 0 ? 0 : n
            }

            function h(e, t) {
                var n = t - e.deltax;
                return n = n > t ? t : n
            }

            function p(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = e.target || U, e.handle = e.handle || M, n && n.close(), he = !0, ae = !0, G && (n = B, i = U, ye.addEventListener("click", E, !0)), ce && L(0, 0, e.transition, e.target), se && L(-V, 0, e.transition, e.handle)
            }

            function g(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = e.target || W, e.handle = e.handle || M, n && n.close(), he = !0, re = !0, G && (n = B, i = W, ye.addEventListener("click", E, !0)), ce && L(0, 0, e.transition, e.target), se && L(V, 0, e.transition, e.handle)
            }

            function v(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = e.target || Y, e.handle = e.handle || M, n && n.close(), he = !0, le = !0, G && (n = B, i = Y, ye.addEventListener("click", E, !0)), ce && L(0, 0, e.transition, e.target), se && L(0, -V, e.transition, e.handle)
            }

            function m(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = e.target || $, e.handle = e.handle || M, n && n.close(), he = !0, oe = !0, G && (n = B, i = $, ye.addEventListener("click", E, !0)), ce && L(0, 0, e.transition, e.target), se && L(0, V, e.transition, e.handle)
            }

            function b(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = de || W, e.handle = fe || M, he = !1, re = !1, G && (n = null, i = null, de = null, fe = null, ye.removeEventListener("click", E, !0)), ce && L(-(V + 1), 0, e.transition, e.target), se && L(be, 0, e.transition, e.handle)
            }

            function w(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = de || U, e.handle = fe || M, he = !1, ae = !1, G && (n = null, i = null, de = null, fe = null, ye.removeEventListener("click", E, !0)), ce && L("101%", 0, e.transition, e.target), se && L(-be, 0, e.transition, e.handle)
            }

            function y(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = de || Y, e.handle = fe || M, he = !1, le = !1, G && (n = null, i = null, de = null, fe = null, ye.removeEventListener("click", E, !0)), ce && L(0, "100%", e.transition, e.target), se && L(0, -be, e.transition, e.handle)
            }

            function x(e) {
                e = e || {}, e.transition = e.transition || J.transition, e.target = de || $, e.handle = fe || M, he = !1, oe = !1, G && (n = null, i = null, de = null, fe = null, ye.removeEventListener("click", E, !0)), ce && L(0, -V, e.transition, e.target), se && L(0, be, e.transition, e.handle)
            }

            function k() {
                b(), w(), x(), y(), R.call(this, "close")
            }

            function T() {
                re && b(), ae && w(), oe && x(), le && y(), R.call(this, "close")
            }

            function C() {
                return T(), this
            }

            function S(e) {
                var t = e || {};
                t.transition = t.transition || J.transition, t.index = t.index || 0;
                var n, i = t.target;
                switch (i) {
                    case"swiperight":
                        t.target = W.eq(t.index), n = t.target.parent().index(), t.handle = G ? A.children().eq(n).children(J.handle) : M, fe = t.handle, de = t.target, ee && g(t);
                        break;
                    case"swipeleft":
                        t.target = U.eq(t.index), n = t.target.parent().index(), t.handle = G ? A.children().eq(n).children(J.handle) : M, fe = t.handle, de = t.target, te && p(t);
                        break;
                    case"swipedown":
                        t.target = $.eq(t.index), n = t.target.parent().index(), t.handle = G ? A.children().eq(n).children(J.handle) : M, fe = t.handle, de = t.target, ie && m(t);
                        break;
                    case"swipeup":
                        t.target = Y.eq(t.index), n = t.target.parent().index(), t.handle = G ? A.children().eq(n).children(J.handle) : M, fe = t.handle, de = t.target, ne && v(t);
                        break;
                    default:
                        t.target = W.eq(t.index), n = t.target.parent().index(), t.handle = G ? A.children().eq(n).children(J.handle) : M, fe = t.handle, de = t.target, ee && g(t)
                }
                return R.call(this, "open", i), this
            }

            function O() {
                return n
            }

            function I() {
                return he
            }

            function E(e) {
                var i = t(e.target),
                    a = i.closest(U).length || i.closest(W).length || i.closest(Y).length || i.closest($).length || e.target.className.indexOf("bui-mask") > -1 || e.target.className.indexOf("bui-click") > -1;
                n && (a || (n.close(), e.stopPropagation()))
            }

            function j() {
                A.on("touchstart", c).on("touchmove", u).on("touchend", d).on("touchcancel", function () {
                    k()
                }), ue = !0
            }

            function L(e, t, n, i) {
                var n, a = i || A, e = e || 0, t = t || 0,
                    r = J.zoom ? parseFloat(e) / 100 + "rem" : parseFloat(e) + "px",
                    o = J.zoom ? parseFloat(t) / 100 + "rem" : parseFloat(t) + "px",
                    l = String(e).indexOf("%") > -1 ? e : r, s = String(t).indexOf("%") > -1 ? t : o;
                return n = "number" == typeof n ? "all " + n + "ms" : n || "all 300ms", a.css({
                    "-webkit-transition": n,
                    transition: n,
                    "-webkit-transform": "translate(" + l + "," + s + ")",
                    transform: "translate(" + l + "," + s + ")"
                }).one("webkitTransitionEnd", function () {
                    a.css({"-webkit-transition": "none", transition: "none"})
                }), this
            }

            function F() {
                return A.off("touchmove", u).off("touchend", d).off("touchcancel", function () {
                }), R.call(this, "lock"), this
            }

            function N() {
                return A.on("touchmove", u).on("touchend", d).on("touchcancel", function () {
                    k()
                }), R.call(this, "unlock"), this
            }

            function D(t, n) {
                return e.on.apply(B, arguments), this
            }

            function P(t, n) {
                return e.off.apply(B, arguments), this
            }

            function R(t) {
                B.self = this == window || this == B ? null : this, e.trigger.apply(B, arguments)
            }

            var A, M, z, V, q, H, U, W, Y, $, X, _ = {
                    id: "",
                    handle: ".handle",
                    swiperight: ".swiperight",
                    swipeleft: ".swipeleft",
                    swipeup: ".swipeup",
                    swipedown: ".swipedown",
                    direction: "x",
                    hasChild: !1,
                    handleMove: !0,
                    targetMove: !0,
                    alwaysTrigger: !1,
                    width: 0,
                    height: 0,
                    movingDistance: 280,
                    initDistance: 0,
                    zoom: !1,
                    distance: 80,
                    transition: 300
                }, B = {handle: {}, active: O, isActive: I, on: D, off: P, close: C, open: S, lock: F, unlock: N, init: r},
                J = B.config = t.extend(!0, {}, _, e.config.swipe, a), K = {}, Z = J.direction, G = J.hasChild, Q = !1,
                ee = !1, te = !1, ne = !1, ie = !1, ae = !1, re = !1, oe = !1, le = !1, se = J.handleMove,
                ce = J.targetMove, ue = !1, de = null, fe = null, he = !1,
                pe = /hp-tablet/gi.test(navigator.appVersion), ge = "ontouchstart" in window && !pe, ve = !1, me = !1,
                K = {
                    x1: 0,
                    x2: 0,
                    y1: 0,
                    y2: 0,
                    direction: "",
                    deltax: 0,
                    movingleft: 0,
                    movingright: 0,
                    movingup: 0,
                    movingdown: 0
                }, be = J.initDistance, we = document, ye = we.documentElement;
            r(J);
            return B
        }
    }(), e
}(bui || {}, libs), function (e, t) {
    return e.sidebar = function (n) {
        function i(n) {
            var i = t.extend(!0, w, n);
            return w = b.config = i, i.trigger && (T = t(i.trigger) || e.obj(i.trigger)), $handle = e.obj(i.handle), v = bui.swipe({
                id: i.id,
                handle: i.handle,
                movingDistance: i.width,
                swiperight: i.swiperight,
                swipeleft: i.swipeleft,
                direction: "x",
                hasChild: !1,
                width: 0,
                height: 0,
                handleMove: i.handleMove,
                zoom: i.zoom,
                distance: i.distance,
                transition: 300
            }), w.mask && (y = bui.mask({
                appendTo: i.handle, autoTrigger: !1, opacity: .01, callback: function () {
                    v.close()
                }
            })), k || a(), this
        }

        function a() {
            var e = this;
            v.on("open", function (t) {
                T && T.addClass("active"), y && y.show(), $handle.css("overflow-y", "hidden"), x = !0, g.call(e, "open", t)
            }), v.on("close", function () {
                T && T.removeClass("active"), y && y.hide(), $handle.css("overflow-y", "auto"), x = !1, g.call(e, "close")
            }), T && T.on("click", function () {
                if (!t(this).hasClass("disabled")) {
                    var e = t(this).attr("data-target") || void 0;
                    x ? o() : r({target: e})
                }
            }), k = !0
        }

        function r(e) {
            var t = e || {};
            return t.target = t.target || "swiperight", t.transition = t.transition || 300, v.open(t), this
        }

        function o() {
            return v.close(), this
        }

        function l() {
            return v.lock(), g.call(this, "lock"), this
        }

        function s(e) {
            return v.unlock(), g.call(this, "unlock"), this
        }

        function c() {
            return x
        }

        function u() {
            return v.active()
        }

        function d(t) {
            var n = {swipe: v, mask: y};
            return e.widget.call(n, t)
        }

        function f(t, n) {
            return e.option.call(b, t, n)
        }

        function h(t, n) {
            return e.on.apply(b, arguments), this
        }

        function p(t, n) {
            return e.off.apply(b, arguments), this
        }

        function g(t) {
            b.self = this == window || this == b ? null : this, e.trigger.apply(b, arguments)
        }

        var v, m = {
            id: "",
            trigger: "",
            handle: ".bui-page",
            swiperight: ".swiperight",
            swipeleft: ".swipeleft",
            handleMove: !0,
            mask: !0,
            width: 280,
            height: 0,
            zoom: !0,
            distance: 80
        }, b = {
            handle: {},
            on: h,
            off: p,
            active: u,
            isActive: c,
            open: r,
            close: o,
            lock: l,
            unlock: s,
            widget: d,
            option: f,
            config: w,
            init: i
        }, w = b.config = t.extend(!0, {}, m, e.config.sidebar, n), y = null, x = !1, k = !1, T = null;
        return i(w), b
    }, e
}(bui || {}, libs), function (e, t) {
    return e.listview = function (n) {
        function i(n) {
            var i = t.extend(!0, y, n);
            return y = w.config = i, v = e.obj(i.id), m = v.children(), m.length && a(i), x || r(i), this
        }

        function a(e) {
            e.data.length ? m.each(function (n, i) {
                var a = t(i), r = a.attr("status"), l = e.height || t(i).height();
                if (!r) {
                    var s = o(e);
                    a.append(s).attr("status", "1")
                }
                i.style.height || t(i).height(l)
            }) : m.each(function (n, i) {
                var a = e.height || t(i).height();
                i.style.height || t(i).height(a)
            })
        }

        function r(e) {
            var t = this, n = function (t) {
                e.callback && e.callback.call(this, t, g)
            };
            v.on("click.bui", ".bui-listview-menu .bui-btn", n), g = bui.swipe({
                id: e.id,
                handle: e.handle,
                movingDistance: e.width,
                swiperight: e.swiperight,
                swipeleft: e.swipeleft,
                direction: "x",
                hasChild: !0,
                width: 0,
                height: 0,
                zoom: y.zoom,
                distance: e.distance,
                transition: 300
            }), g.on("open", function (e) {
                k = !0, p.call(t, "open", e)
            }), g.on("close", function (e) {
                k = !1, p.call(t, "close", e)
            }), x = !0
        }

        function o(e) {
            var n = "", i = "right" == e.position ? e.swipeleft.substr(1) : e.swiperight.substr(1);
            return n += '<div class="bui-listview-menu ' + i + '">', t.each(e.data, function (e, t) {
                n += '    <div class="bui-btn ' + t.classname + '">' + t.text + "</div>"
            }), n += "</div>"
        }

        function l() {
            return g.active()
        }

        function s(e) {
            var t = e || {};
            return t.target = t.target || ("right" == y.position ? y.swipeleft.substr(1) : y.swiperight.substr(1)), t.transition = t.transition || 300, t.index = t.index || 0, g.open(t), this
        }

        function c() {
            return g.close(), this
        }

        function u() {
            return g.lock(), p.call(this, "lock"), this
        }

        function d(e) {
            return g.unlock(), p.call(this, "unlock"), this
        }

        function f(t) {
            var n = {swipe: g};
            return e.widget.call(n, t)
        }

        function h(t, n) {
            return e.option.call(w, t, n)
        }

        function p(t) {
            w.self = this == window || this == w ? null : this, e.trigger.apply(w, arguments)
        }

        var g, v, m, b = {
                id: "",
                data: [],
                handle: ".bui-btn",
                swiperight: ".swiperight",
                swipeleft: ".swipeleft",
                position: "right",
                width: 160,
                height: 0,
                distance: 80,
                zoom: !1,
                callback: null
            }, w = {active: l, lock: u, unlock: d, open: s, close: c, widget: f, option: h, config: y, init: i},
            y = w.config = t.extend(!0, {}, b, e.config.listview, n), x = !1, k = !1;
        return i(y), w
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.btn = function (n) {
        function i(t) {
            return "object" === bui["typeof"](t) ? (d.id = t.id || "", d.handle = t.handle || "", d.progress = "progress" in t ? t.progress : !1, d.replace = "replace" in t ? t.replace : !1, d.timeout = t.timeout || 3e3) : "string" === bui["typeof"](t) && (d.id = t || "", d.handle = "", d.progress = !1, d.replace = !1, d.timeout = 3e3), l = e.obj(d.id), u = d.handle, s = d.progress, c = d.replace, this
        }

        function a(n, i) {
            n = n, i = i;
            o();
            var a = 0;
            l.on("click.bui", u, function (r) {
                var o = n || t(this).attr("href"), l = t(this).attr("target"),
                    u = !(!t(this).hasClass("disabled") && "disabled" != t(this).attr("disabled"));
                if (o && !u) {
                    var f, h = t(this).attr("param") || "",
                        p = h && h.indexOf("{") > -1 && h.indexOf("}") > -1 ? JSON.parse(t(this).attr("param")) : {},
                        g = t.extend(!0, p, i), v = t(this).attr("progress") ? "false" != t(this).attr("progress") : s;
                    v && (f = e.loading({autoTrigger: !0, timeout: d.timeout}));
                    var m = +new Date;
                    if (350 > m - a) return !1;
                    a = m;
                    var b = {url: o, param: g, replace: c};
                    return "_blank" == l ? e.run({id: o, data: g}) : e.load(b), !1
                }
            })
        }

        function r(n, i) {
            var i = i || {};
            o(), l.on("click.bui", u, function (a) {
                var r = this, o = t(r).css("background"), l = "none" == o ? "#fff" : o;
                i.appendTo = r, i.background = i.background || l, i.autoClose = 0 != i.autoClose, i.autoTrigger = 0 != i.autoTrigger;
                var s = e.loading(i);
                return n && n.call(r, s)
            })
        }

        function o() {
            return l.off("click.bui", u), this
        }

        var l, s, c, u, d = {};
        return i(n), {load: a, submit: r, off: o}
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.dialog = function (n) {
        function i(n) {
            var i = t.extend(!0, T, n);
            switch (w = i.effect, i.position) {
                case"top":
                    C = "bui-dialog-top", w = i.effect || "fadeInDown";
                    break;
                case"bottom":
                    C = "bui-dialog-bottom", w = i.effect || "fadeInUp";
                    break;
                case"left":
                    C = "bui-dialog-left", w = i.effect || "fadeInLeft";
                    break;
                case"right":
                    C = "bui-dialog-right", w = i.effect || "fadeInRight";
                    break;
                case"center":
                    C = "bui-dialog-center", w = i.effect || I
            }
            i.fullscreen && (C = "bui-dialog-fullscreen", w = i.effect || I), i.render ? (i.id = e.guid(), d(i), m = e.obj(i.id)) : (m = e.obj(i.id), m.addClass(C)), S = m.width() > L ? L : m.width(), O = m.height() > F ? F : m.height(), m.css("display", "none"), b = e.toggle({
                id: i.id,
                effect: w
            });
            try {
                y = n.mask && e.mask({
                    opacity: n.opacity, autoTrigger: !1,
                    autoClose: !1, callback: function (e) {
                        n.onMask && n.onMask()
                    }
                })
            } catch (a) {
                console.log(a)
            }
            return E || f(), T = k.config = i, this
        }

        function a(e) {
            var n = "";
            return n += '<div id="' + e.id + '" class="bui-dialog ' + C + " " + e.className + '" style="display:block">', e.title && (n += '	<div class="bui-dialog-head">' + e.title + "</div>"), n += '	<div class="bui-dialog-main">', e.content && (n += e.content), n += "	</div>", e.buttons && e.buttons.length && (n += '	<div class="bui-dialog-foot bui-box">', t(e.buttons).each(function (e, t) {
                n += '		<div class="bui-btn span1 ' + (t.className || "") + '" value="' + (t.value || "") + '">' + (t.name || t) + "</div>"
            }), n += "	</div>"), e.close && (n += '   <div class="bui-dialog-close">' + (e.closeText ? e.closeText : '<i class="icon-close"></i>') + "</div>"), n += "</div>"
        }

        function r(t) {
            if (!s) {
                m.css("display", "block");
                var n = m.attr("status") || 0;
                if (0 == n) {
                    S = T.width || S || m.width(), O = T.height || O || m.height();
                    var i = e.unit.pxToRemZoom(S), a = e.unit.pxToRemZoom(O), r = T.zoom ? i + "rem" : S + "px",
                        o = T.zoom ? a + "rem" : O + "px", c = T.zoom ? "-" + a / 2 + "rem" : "-" + O / 2 + "px",
                        u = T.zoom ? "-" + i / 2 + "rem" : "-" + S / 2 + "px";
                    if ("center" != T.position || T.fullscreen || m.css({
                        width: r,
                        height: o,
                        top: "50%",
                        "margin-top": c,
                        left: "50%",
                        "margin-left": u,
                        right: "auto"
                    }), "left" != T.position && "right" != T.position || T.fullscreen || m.css({width: r}), "top" != T.position && "bottom" != T.position || T.fullscreen || m.css({height: o}), T.scroll) {
                        var d = m.children(".bui-dialog-head"), h = m.children(".bui-dialog-foot"),
                            p = m.children(".bui-dialog-main"), g = d.length ? d.height() : 0,
                            v = h.length ? h.height() : 0, w = m.height() - g - v;
                        p.css({height: w})
                    }
                    m.attr("status", "1")
                }
                return b.show(function (e) {
                    s = !0, t && t.call(k, b)
                }), y && y.show(), E || f(), l.call(this, "open", {currentTarget: null}), this
            }
        }

        function o(e, t) {
            "undefined" == typeof j[e] && (j[e] = []), j[e].push(t)
        }

        function l(e, t) {
            if (j[e] instanceof Array) for (var n = j[e], i = 0, a = n.length; a > i; i++) n[i](t)
        }

        function s(e) {
            return s
        }

        function c(t) {
            if (s) {
                var t = t || T.onClose;
                try {
                    b.hide(function (e) {
                        s = !1, t && t.call(k, b)
                    }), y && y.hide(), l.call(this, "close", {currentTarget: null})
                } catch (n) {
                    e.showLog(n, "bui.dialog.close")
                }
                return this
            }
        }

        function u() {
            try {
                m.remove(), l.call(this, "remove", {currentTarget: null})
            } catch (t) {
                e.showLog(t, "bui.dialog.remove")
            }
            return this
        }

        function d(e) {
            var n = a(e);
            return t("body").append(n), this
        }

        function f() {
            return m.on("click.bui", ".bui-dialog-close", function (e) {
                T.onClose && T.onClose.call(this, k), T.autoClose && (T.render ? c(u) : c()), e.stopPropagation()
            }), m.on("click.bui", ".bui-dialog-foot .bui-btn", function (e) {
                T.callback && T.callback.call(this, k), T.autoClose && (T.render ? c(u) : c()), e.stopPropagation()
            }), E = !0, this
        }

        function h(e) {
            return x.title = "提示", x.content = "", x.close = !1, x.render = !0, x.autoClose = !0, x.mask = !0, x.buttons = ["确定"], T = t.extend(!0, x, e), i(T), l.call(this, "create", {currentTarget: null}), this
        }

        function p(t) {
            var n = {toggle: b};
            return e.widget.call(n, t)
        }

        function g(t, n) {
            return e.option.call(k, t, n)
        }

        function o(t, n) {
            return e.on.apply(k, arguments), this
        }

        function v(t, n) {
            return e.off.apply(k, arguments), this
        }

        function l(t) {
            k.self = this == window || this == k ? null : this, e.trigger.apply(k, arguments)
        }

        var m, b, w, y, x = {
                id: "",
                title: "",
                effect: "",
                content: "",
                className: "",
                position: "center",
                fullscreen: !1,
                width: 0,
                height: 0,
                mask: !0,
                opacity: .6,
                render: !1,
                autoClose: !0,
                close: !0,
                scroll: !0,
                closeText: "",
                zoom: !1,
                buttons: [],
                onMask: null,
                onClose: null,
                callback: null
            }, k = {
                handle: {},
                on: o,
                off: v,
                open: r,
                close: c,
                isOpen: s,
                create: h,
                remove: u,
                widget: p,
                option: g,
                config: T,
                init: i
            }, T = k.config = t.extend(!1, {}, x, e.config.dialog, n), C = "", S = "", O = "", I = "fadeInDown", s = !1,
            E = !1, j = {}, L = document.documentElement.clientWidth, F = document.documentElement.clientHeight;
        return T.id && i(T), k
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.alert = function (n, i) {
        var a = e.dialog(), r = {};
        r.className = "bui-alert", r.title = "提示", r.width = 400, r.height = 260, r.scroll = !0, r.position = "center", r.autoClose = !0, r.zoom = !0, r.buttons = [{
            name: "确定",
            className: "primary-reverse"
        }], r.callback = i || function () {
        };
        var o = t.extend(r, e.config.alert);
        if ("string" == typeof n && n.indexOf("<") > -1 && n.indexOf(">") > -1) o.content = "<xmp>" + n + "</xmp>"; else if ("object" == typeof n) try {
            var l = JSON.stringify(n);
            o.content = '<div class="bui-dialog-text bui-box-center" style="height:100%;">' + l + "</div>"
        } catch (s) {
            e.showLog("数据格式错误,请检查下对象是不是JSON?", "bui.alert")
        } else {
            var l = n;
            o.content = '<div class="bui-dialog-text bui-box-center" style="height:100%;">' + l + "</div>"
        }
        return a.create(o).open(), a
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.confirm = function (n, i) {
        var a = e.dialog(), r = {};
        r.className = "bui-confirm", r.title = "提示", r.width = 400, r.height = 260, r.scroll = !0, r.autoClose = !0, r.zoom = !0, r.position = "center", r.buttons = [{
            name: "取消",
            className: ""
        }, {name: "确定", className: "primary-reverse"}], r.callback = i || function () {
        };
        var o = {};
        return "object" == typeof n ? (n.content = '<div class="bui-dialog-text bui-box-center" style="height:100%;">' + n.content + "</div>", o = t.extend(r, e.config.confirm, n)) : (o = t.extend(r, e.config.confirm), o.content = '<div class="bui-dialog-text bui-box-center" style="height:100%;">' + n + "</div>", o.callback = i || function () {
        }), a.create(o).open(), a
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.prompt = function (n, i) {
        var a = e.dialog(), r = {};
        r.className = "bui-prompt", r.title = "", r.width = 400, r.height = 260, r.scroll = !0, r.autoClose = !1, r.zoom = !0, r.position = "center", r.buttons = [{
            name: "取消",
            className: ""
        }, {name: "确定", className: "primary-reverse"}], r.callback = i || function () {
        }, r.placeholder = "", r.row = 1, r.onChange = null;
        var o = {}, l = "";
        return "object" == typeof n ? (o = t.extend(r, e.config.prompt, n), o.content = '<div class="bui-prompt-main bui-box-vertical"> <div class="bui-prompt-label">' + o.content + '</div> <div class="span1"> <textarea class="bui-prompt-text" placeholder="' + o.placeholder + '" rows="' + o.row + '" ></textarea> </div> </div>') : (o = t.extend(r, e.config.prompt), o.content = '<div class="bui-prompt-main bui-box-vertical"> <div class="bui-prompt-label">' + n + '</div> <div class="span1"> <textarea class="bui-prompt-text" placeholder="' + o.placeholder + '" rows="' + o.row + '"></textarea> </div> </div>', o.callback = i || function () {
        }), a.create(o).open(), a.value = function (e) {
            return "undefined" == typeof e ? l : (t("#" + a.config.id).find(".bui-prompt-text").val(e), l = e)
        }, t("#" + a.config.id).on("change", ".bui-prompt-text", function () {
            l = this.value, o.onChange && o.onChange.call(this, a)
        }), a
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.hint = function (n, i) {
        function a(n) {
            var i = t.extend(!0, k, n);
            return w = e.guid(), C = "top" === i.position ? "fadeInDown" : "bottom" === i.position ? "fadeInUp" : i.effect, k = x.config = i, o(w, i.content, T, i.appendTo), ++T, b = e.toggle({
                id: "#" + w,
                effect: C
            }), S = !0, b.show(), i.autoClose && (y && clearTimeout(y), y = setTimeout(function (e) {
                i.onClose && i.onClose.call(x), s()
            }, i.timeout)), O || r(i), this
        }

        function r(t) {
            e.obj(w).on("click.bui", ".bui-hint-close", function (e) {
                s(), t.onClose && t.onClose.call(this, x)
            }), O = !0
        }

        function o(n, i, a, r) {
            var o, l = "11" + a, s = e.obj(r) || t("body");
            switch (k.position) {
                case"top":
                    o = "bui-hint-top";
                    break;
                case"bottom":
                    o = "bui-hint-bottom";
                    break;
                case"center":
                    o = "bui-hint-center"
            }
            var c = k.background ? k.background : "rgba(0,0,0," + k.opacity + ")",
                u = '<div id="' + n + '" class="bui-hint ' + o + '" style="background:' + c + ";z-index:" + l + '">' + i + (k.autoClose ? "" : '<div class="bui-hint-close"><i class="icon-close"></i></div>') + "</div>";
            s.append(u), r && s.css("position", "relative")
        }

        function l() {
            return S
        }

        function s() {
            var e = this;
            return b && (S = !1, b.hide(function () {
                g.call(e, "hide", {currentTarget: null}), b.remove(), b = null
            })), this
        }

        function c(e) {
            var t = this;
            return b && (S = !1, b.hide(function (n) {
                e && e.call(this, x), g.call(t, "hide", {currentTarget: null})
            })), this
        }

        function u(e) {
            var t = this;
            return b && (S = !0, b.show(function (n) {
                g.call(t, "show", {currentTarget: null}), e && e.call(this, x)
            })), this
        }

        function d(t) {
            var n = {toggle: b};
            return e.widget.call(n, t)
        }

        function f(t, n) {
            return e.option.call(x, t, n)
        }

        function h(t, n) {
            return e.on.apply(x, arguments), this
        }

        function p(t, n) {
            return e.off.apply(x, arguments), this
        }

        function g(t) {
            x.self = this == window || this == x ? null : this, e.trigger.apply(x, arguments)
        }

        var v = {
            appendTo: "",
            content: "",
            timeout: 2e3,
            autoClose: !0,
            opacity: .6,
            background: "",
            effect: "fadeInUp",
            position: "bottom",
            onClose: null
        };
        if ("number" == typeof n || "string" == typeof n) {
            var m = n || "";
            n = {}, n.content = m, n.onClose = i || null
        } else "object" == typeof n && n.content && (n = n);
        var b, w, y, x = {
            handle: {},
            on: h,
            off: p,
            remove: s,
            hide: c,
            show: u,
            isShow: l,
            widget: d,
            option: f,
            config: k,
            init: a
        }, k = x.config = t.extend(!0, {}, v, e.config.hint, n), T = 0, C = "", S = !1, O = !1;
        return k.content && a(k), x
    }, e
}(bui || {}, libs), function (e, t) {
    return e.pullrefresh = function (n) {
        function i(n) {
            var i = t.extend(!0, A, n);
            return i.id ? (T = e.obj(i.id), A = R.config = i, C = T[0], S = T.children(F), O = T.children(N), I = T.children(D), j = a, E = i.refreshTips.end, L = e.loading({
                appendTo: S,
                width: 20,
                height: 20,
                autoClose: !1,
                text: E,
                onlyText: !0,
                display: "inline",
                autoTrigger: !1,
                mask: !1,
                callback: function (e) {
                    v()
                }
            }), i.autoLoad && (V = !0, L.start({
                text: i.refreshTips.start,
                onlyText: !1
            }), j()), q || o(i), m(i.height), this) : void e.hint("pullrefresh id不能为空")
        }

        function a() {
            z = (new Date).getTime(), A.onRefresh && A.onRefresh.call(R), k.call(this, "refresh")
        }

        function r() {
            var e, t = (new Date).getTime(), n = t - z, i = 1e3, a = 60 * i, r = 60 * a, o = Math.floor(n / r),
                l = Math.floor(n / a);
            Math.floor(n / i);
            return e = 0 >= o && 0 >= l ? "刚刚更新" : 0 >= o && l > 0 ? l + "分钟前更新" : "上次更新时间:" + (10 > o ? "0" + o : o) + ":" + (10 > l ? "0" + l : l)
        }

        function o(e) {
            M || d(), q = !0
        }

        function l(e) {
            var n = e.originalEvent && e.originalEvent.targetTouches || e.targetTouches, i = W ? n[0] : e;
            B.x1 = i.pageX, B.y1 = i.pageY, B.direction = "", E = A.lastUpdated ? r() : A.refreshTips.end, k.call(this, "touchstart", e, B), X = !(!(t(window).scrollTop() <= 0 && T.scrollTop() <= 0 && A.onRefresh) || V)
        }

        function s(t) {
            var n = t.originalEvent && t.originalEvent.targetTouches || t.targetTouches;
            if (n.length > 1 || t.scale && 1 !== t.scale) return void h();
            if (!X) return void h();
            var i = W ? n[0] : t;
            B.x2 = i.pageX, B.y2 = i.pageY, B.direction || (B.direction = e.swipeDirection(B.x1, B.x2, B.y1, B.y2)), k.call(this, "touchmove", t, B), "swipeleft" !== B.direction && "swiperight" !== B.direction || t.preventDefault(), "swipedown" == B.direction ? (k.call(this, "movingdown", t, B), moveY = Math.abs(B.y2 - B.y1), h(moveY / 2, !1), moveY >= A.distance ? J || (L.show({
                text: A.refreshTips.release,
                onlyText: !1
            }).pause(), J = !0) : K || (L.show({
                text: E,
                onlyText: !1
            }).pause(), K = !0), t.preventDefault(), t.stopPropagation()) : "swipeup" == B.direction && k.call(this, "movingup", t, B), _ = !0
        }

        function c(e) {
            k.call(this, "touchend", e, B), _ && ("swipedown" == B.direction ? (k.call(this, B.direction, e, B), moveY >= A.distance ? (h(A.distance / 2), L.show({
                text: A.refreshTips.start,
                onlyText: !1
            }).start(), V = !0, A.onRefresh && j()) : h(), e.stopPropagation(), J = !1, K = !1, B = {}) : "swipeup" == B.direction && k.call(this, B.direction, e, B), Y += B.y2 - B.y1, $ += B.x2 - B.x1, B.lastX = $, B.lastY = Y, B = {
                x1: 0,
                x2: 0,
                y1: 0,
                y2: 0,
                direction: ""
            }, X = !1, _ = !1)
        }

        function u(e) {
            return M = !0, T.off("touchstart", l).off("touchmove", s).off("touchend", c).off("touchcancel", h), h(), e && e.call(this, R), k.call(this, "lock"), this
        }

        function d(e) {
            return M = !1, T.on("touchstart", l).on("touchmove", s).on("touchend", c).on("touchcancel", h), e && e.call(this, R), k.call(this, "unlock"), this
        }

        function f(e, t, n) {
            return H || (L.show({
                text: A.refreshTips.success,
                onlyText: !1
            }), h(e, t), O.one("webkitTransitionEnd", function () {
                L && L.hide(), H = !1, n && n.call(R)
            })), this
        }

        function h(e, t) {
            t = 0 != t, e = e || 0, V = !1;
            var n = t ? "all 300ms ease-out" : "none";
            return p(0, e + "px", n, O), I.length && p(0, e + "px", n, I), this
        }

        function p(e, t, n, i) {
            var n, i = i || T, e = e || 0, t = t || 0, a = e, r = t, o = String(e).indexOf("%") > -1 ? String(e) : a,
                l = String(t).indexOf("%") > -1 ? String(t) : r;
            n = "number" == typeof n ? "all " + n + "ms" : n || "all 300ms";
            try {
                i.css({
                    "-webkit-transition": n,
                    transition: n,
                    "-webkit-transform": "translate(" + o + "," + l + ")",
                    transform: "translate(" + o + "," + l + ")"
                }), i.one("webkitTransitionEnd", function () {
                    i.css({"-webkit-transition": "none", transition: "none"})
                })
            } catch (s) {
                console.log(s.message)
            }
        }

        function g() {
            H = !0, h(), e.hint(A.refreshTips.fail), k.call(this, "fail")
        }

        function v() {
            h(A.distance / 2, !0), L.start({text: A.refreshTips.start, onlyText: !1}), A.onRefresh && j()
        }

        function m(e) {
            var n = T.parents("main"), i = C && C.offsetTop || 0, a = t(A.header),
                r = a.length > 1 ? a.eq(a.length - 1).height() : a.height(), o = t(A.footer),
                l = o.length > 1 ? o.eq(o.length - 1).height() : o.height(),
                s = n.length ? n.height() - i : t(window).height() - (r || 0) - (l || 0) - i, c = e ? parseFloat(e) : s;
            T.height(c)
        }

        function b(t) {
            var n = {loading: L};
            return e.widget.call(n, t)
        }

        function w(t, n) {
            return e.option.call(R, t, n)
        }

        function y(t, n) {
            return e.on.apply(R, arguments), this
        }

        function x(t, n) {
            return e.off.apply(R, arguments), this
        }

        function k(t) {
            R.self = this == window || this == R ? null : this, e.trigger.apply(R, arguments)
        }

        var T, C, S, O, I, E, j, L, F = "." + e.prefix("scroll-head"), N = "." + e.prefix("scroll-main"),
            D = "." + e.prefix("scroll-foot"), P = {
                id: "",
                childrenTop: F,
                childrenMain: N,
                header: ".bui-page header",
                footer: ".bui-page footer",
                distance: 90,
                autoLoad: !0,
                lastUpdated: !1,
                height: 0,
                refreshTips: {start: "刷新中..", release: "松开刷新", end: "下拉刷新", fail: "刷新失败,请检查下网络再试试", success: "刷新成功"},
                onRefresh: null
            }, R = {
                handle: {},
                on: y,
                off: x,
                reverse: f,
                refresh: v,
                setHeight: m,
                fail: g,
                lock: u,
                unlock: d,
                widget: b,
                option: w,
                config: A,
                init: i
            }, A = R.config = t.extend(!0, {}, P, e.config.pullrefresh, n), M = !1, z = (new Date).getTime(), V = !1,
            q = !1, H = !1, U = /hp-tablet/gi.test(navigator.appVersion), W = "ontouchstart" in window && !U, Y = 0,
            $ = 0, X = !1, _ = !1, B = {x1: 0, x2: 0, y1: 0, y2: 0, direction: ""};
        i(A);
        var J = !1, K = !1;
        return R
    }, e
}(bui || {}, libs), function (e, t) {
    return e.scroll = function (n) {
        function i(n) {
            var i = t.extend(!0, Y, n);
            if (L = t(window), !i.id) return void e.hint("scroll id不能为空");
            E = e.obj(i.id), Q = i.page, ee = i.pageSize, Y = W.config = i, J = !0, K = !0, Z = !1, G = !1, j = E[0], $childrenTop = E.children(V), D = E.children(q), N = E.children(H), D.css({position: "relative"}), A = e.loading({
                appendTo: N,
                width: 20,
                height: 20,
                autoClose: !1,
                text: i.scrollTips.start,
                display: "inline",
                autoTrigger: !1,
                mask: !1
            }), P = l, R = o, M ? M.init({
                id: i.id,
                onRefresh: P,
                distance: i.distance,
                lastUpdated: i.lastUpdated,
                height: i.height,
                refreshTips: i.refreshTips,
                autoLoad: i.autoRefresh
            }) : i.refresh && i.onRefresh ? (M = e.pullrefresh({
                id: i.id,
                onRefresh: P,
                distance: i.distance,
                lastUpdated: i.lastUpdated,
                header: i.header,
                footer: i.footer,
                height: i.height,
                refreshTips: i.refreshTips,
                autoLoad: i.autoRefresh
            }), M.lock(), _ = !0) : v(i.height);
            try {
                R && R.call(W, Q, ee)
            } catch (r) {
                e.showLog(r)
            }
            return te || a(i), this
        }

        function a(t) {
            E.on("scroll", e.unit.debounce(r, t.delayTime)), te = !0
        }

        function r(e) {
            var t = e.target, n = t.scrollTop || 0;
            0 == n ? I.call(this, "scrolltop", e) : t.scrollTop + t.clientHeight >= (t && t.scrollHeight - Y.endDistance) && Y.onLoad && (Y.page = W.config.page = ++Q, Y.autoScroll && R && R.call(W, Y.page, ee), I.call(this, "scrollbottom", e)), I.call(this, "scrollend", e), Y.onScrolling && Y.onScrolling.call(this, e, W)
        }

        function o(e, t) {
            return B = !0, G = !1, K && !Z && (Y.page = W.config.page = e, A && A.start({
                text: Y.scrollTips.start,
                onlyText: !1
            }), Y.onLoad && Y.onLoad.call(W, e, t)), _ && Y.refresh && M && M.unlock(), this
        }

        function l() {
            B = !0, K = !0, Z = !1, J = !1, G = !0, Q = $, ee = Y.pageSize, ne = {}, A && A.start({
                text: Y.scrollTips.end,
                onlyText: !0
            }), Y.page = W.config.page = Q, I.call(this, "refresh", Q), Y.onRefresh && Y.onRefresh.call(W, Q, ee)
        }

        function s(t, n, i) {
            var i = 0 != i;
            if (!n || "array" != bui["typeof"](n)) return e.showLog("scroll 控件的updateCache 第2个参数,必须是一个数组,如果是list控件,检测field的data映射是否准确", "bui.scroll.updateCache"), void (n = []);
            n = n, B = !1;
            var a = parseInt(E.height()),
                r = parseInt(E.find(Y.childrenMain)[0] && E.find(Y.childrenMain)[0].scrollHeight);
            if (i) if (n && n.length > ee - 1) {
                if (K = !0, Z = !1, J = !1, A && A.start({
                    text: Y.scrollTips.end,
                    onlyText: !0
                }), r >= 10 && a > r && Y.autoNext) {
                    var o = ++Q;
                    R && R.call(W, o, ee)
                }
                I.call(this, "loadpage", n, Q)
            } else {
                K = !1, Z = !0;
                var l = J && n.length < 1 ? Y.scrollTips.nodata : Y.scrollTips.last;
                A && A.start({text: l, onlyText: !0}), I.call(this, "loadpage", n, Q), I.call(this, "lastpage", n, Q)
            } else K = !1, Z = !0, A && A.stop();
            return ne[t] = n
        }

        function c(e) {
            return M && M.reverse(), e && e.call(W, M), this
        }

        function u() {
            return G
        }

        function d(e) {
            return ne
        }

        function f(e) {
            ne = {}
        }

        function h(e, t) {
            return X = !0, _ = !0, A.show({
                text: Y.scrollTips.fail, onlyText: !0, callback: function (n) {
                    o(e, t)
                }
            }), M && M.lock(), this
        }

        function p(t, n) {
            var i, a, r = [];
            if (t && n) for (i in ne) {
                var o = e.filterArray(t, ne[i], n);
                if (o.length) for (a in o) r.push(o[a])
            }
            return r
        }

        function g(e, t) {
            var e = e || 0;
            F = E.find(Y.children).children(Y.handle);
            var n = E.height(), i = parseFloat(F.height()), a = j.scrollHeight, r = i * parseInt(e) - i;
            return a > n && (j.scrollTop = r, I.call(this, "to", e), t && t.call(W, parseInt(e))), this
        }

        function v(e) {
            var n = E.parents("main"), i = j && j.offsetTop || 0, a = t(Y.header),
                r = a.length > 1 ? a.eq(a.length - 1).height() : a.height(), o = t(Y.footer),
                l = o.length > 1 ? o.eq(o.length - 1).height() : o.height(),
                s = n.length ? n.height() - i : t(window).height() - (r || 0) - (l || 0) - i, c = e ? parseFloat(e) : s;
            E.height(c)
        }

        function m() {
            return E.off("scroll", e.unit.debounce(r, Y.delayTime)), I.call(this, "lock"), this
        }

        function b(t) {
            return E.on("scroll", e.unit.debounce(r, Y.delayTime)), I.call(this, "unlock"), this
        }

        function w() {
            return g(1), M && M.refresh(), this
        }

        function y(e) {
            var e = e || Q;
            return Q = e, R && R.call(W, Q, ee), this
        }

        function x() {
            return R && R.call(W, ++Q, ee), this
        }

        function k() {
            return Q-- > 0 && R && R.call(W, Q--, ee), this
        }

        function T(t) {
            var n = {pullrefresh: M, loading: A};
            return e.widget.call(n, t)
        }

        function C(t, n) {
            return e.option.call(W, t, n)
        }

        function S(t, n) {
            return e.on.apply(W, arguments), this
        }

        function O(t, n) {
            return e.off.apply(W, arguments), this
        }

        function I(t) {
            W.self = this == window || this == W ? null : this, e.trigger.apply(W, arguments)
        }

        var E, j, L, F, N, D, P, R, A, M, z = "." + e.prefix("list"), V = "." + e.prefix("scroll-head"),
            q = "." + e.prefix("scroll-main"), H = "." + e.prefix("scroll-foot"), U = {
                id: "",
                childrenTop: V,
                childrenMain: q,
                childrenBottom: H,
                children: z,
                header: ".bui-page header",
                footer: ".bui-page footer",
                handle: "li",
                distance: 100,
                endDistance: 1,
                height: 0,
                page: 1,
                pageSize: 10,
                lastUpdated: !0,
                autoRefresh: !1,
                autoNext: !0,
                autoScroll: !0,
                refresh: !0,
                delayTime: 100,
                scrollTips: {start: "努力加载中..", end: "上拉加载更多", nodata: "没有更多内容", last: "没有更多内容", fail: "点击重新加载"},
                refreshTips: {start: "刷新中..", release: "松开刷新", end: "下拉刷新", fail: "点击加载", success: "刷新成功"},
                onScrolling: null,
                onRefresh: null,
                onLoad: null
            }, W = {
                handle: {},
                on: S,
                off: O,
                reverse: c,
                updateCache: s,
                getCache: d,
                clearCache: f,
                fail: h,
                filter: p,
                to: g,
                lock: m,
                unlock: b,
                refresh: w,
                load: y,
                nextPage: x,
                prevPage: k,
                setHeight: v,
                isRefresh: u,
                widget: T,
                option: C,
                config: Y,
                init: i
            }, Y = W.config = t.extend(!0, {}, U, e.config.scroll, n), $ = Y.page, X = !1, _ = !1, B = !1, X = !1, J = !0,
            K = !0, Z = !1, G = !1, Q = Y.page, ee = Y.pageSize, te = !1, ne = {};
        return i(Y), W
    }, e
}(bui || {}, libs), function (e, t) {
    return e.list = function (n) {
        function i(n) {
            var i = t.extend(!0, k, n);
            g = e.obj(i.id), k = x.config = i, C = k.data;
            var o = 0 == k.refresh ? null : l;
            return k.url ? (w ? w.init({
                id: i.id,
                children: i.children,
                handle: i.handle,
                page: i.page,
                pageSize: i.pageSize,
                height: i.height,
                refresh: i.refresh,
                autoNext: i.autoNext,
                autoScroll: i.autoScroll,
                scrollTips: i.scrollTips,
                refreshTips: i.refreshTips,
                lastUpdated: i.lastUpdated,
                onRefresh: o,
                onLoad: r
            }) : w = bui.scroll({
                id: i.id,
                children: i.children,
                handle: i.handle,
                header: i.header,
                footer: i.footer,
                page: i.page,
                pageSize: i.pageSize,
                height: i.height,
                refresh: i.refresh,
                autoNext: i.autoNext,
                autoScroll: i.autoScroll,
                scrollTips: i.scrollTips,
                refreshTips: i.refreshTips,
                lastUpdated: i.lastUpdated,
                onRefresh: o,
                onLoad: r
            }), v = g.find(i.children), m = v.children(i.handle), S || a(i), this) : void 0
        }

        function a(e) {
            return v.on("click.bui", e.handle, function (t) {
                e.callback && e.callback.call(this, t, x, w)
            }), S = !0, this
        }

        function r(i, a, r) {
            var l = this, s = r || k.commandLoad, c = [], u = [];
            return C = t.extend(!0, {}, O, k.data, C), k.field.page.indexOf(".") > -1 ? (c = k.field.page.split("."), C[c[0]] = C[c[0]] || {}, C[c[0]][c[1]] = i) : C[k.field.page] = i, k.field.size.indexOf(".") > -1 ? (u = k.field.size.split("."), C[u[0]] = C[u[0]] || {}, C[u[0]][u[1]] = a) : C[k.field.size] = a, k.page = x.config.page = i, b = e.ajax({
                url: k.url,
                data: C,
                method: k.method,
                headers: k.headers,
                dataType: k.dataType,
                contentType: k.contentType,
                timeout: k.timeout,
                "native": k["native"]
            }).done(function (e, t, a) {
                var r, c;
                r = "string" == typeof e ? e && JSON.parse(e) || {} : e || {}, c = "" == k.field.data ? r || [] : o(k.field.data, r);
                var u = n.template && n.template(c, r, i) || "";
                n.template && v[s](u);
                var d = w.isRefresh();
                p.call(l, "success", e, i, a);
                try {
                    d ? (k.onRefresh && k.onRefresh.call(x, w, r, a), p.call(l, "refresh", e, i, a), k.refresh && w.reverse()) : k.onLoad && k.onLoad.call(x, w, r, a), w && w.updateCache(i, c)
                } catch (f) {
                }
            }).fail(function (e, t, n) {
                p.call(l, "fail", e, i, n), k.onFail && k.onFail.call(x, t, w, i, n), w && w.fail(i, a, e)
            }), this
        }

        function o(e, t) {
            function n(e) {
                var t, n = e[a[r]], i = a[r + 1];
                return t = "string" == typeof n ? JSON.parse(n) : n || [], i && i in t ? (r++, arguments.callee(t)) : (r = 0, t)
            }

            var i, a = [];
            e.indexOf(".") > -1 ? a = e.split(".") : a.push(e);
            var r = 0;
            return i = n(t)
        }

        function l() {
            var e = T, t = k.pageSize;
            return k.page = x.config.page = e, p.call(this, "refreshbefore"), r(e, t, k.commandRefresh), this
        }

        function s(n, i) {
            var a;
            if ("string" == typeof i) try {
                a = JSON.parse(i)
            } catch (r) {
                return void e.showLog("data 参数必须为对象", "bui.list.modifyData")
            } else a = i;
            return C = t.extend(!0, {}, O, a)
        }

        function c(t) {
            var n = {scroll: w, ajax: b};
            return e.widget.call(n, t)
        }

        function u(t, n) {
            return "data" == t && "undefined" != typeof n ? s(t, n) : e.option.call(x, t, n)
        }

        function d(e) {
            return k = x.config = t.extend(!0, {}, x.config, e), C = k.data, this
        }

        function f(t, n) {
            return e.on.apply(x, arguments), this
        }

        function h(t, n) {
            return e.off.apply(x, arguments), this
        }

        function p(t) {
            x.self = this == window || this == x ? null : this, e.trigger.apply(x, arguments)
        }

        var g, v, m, b, w, y = {
                id: "",
                url: "",
                data: {},
                method: "GET",
                dataType: "json",
                headers: {},
                contentType: "",
                timeout: 2e4,
                field: {page: "page", size: "pageSize", data: ""},
                scrollTips: {start: "努力加载中..", end: "上拉加载更多", nodata: "没有更多内容", last: "没有更多内容", fail: "点击重新加载"},
                refreshTips: {start: "刷新中..", release: "松开刷新", end: "下拉刷新", fail: "点击加载", success: "刷新成功"},
                lastUpdated: !1,
                page: 1,
                pageSize: 10,
                autoNext: !0,
                autoScroll: !0,
                "native": !0,
                refresh: !0,
                children: ".bui-list",
                handle: ".bui-btn",
                header: ".bui-page header",
                footer: ".bui-page footer",
                height: 0,
                commandRefresh: "html",
                commandLoad: "append",
                template: null,
                onRefresh: null,
                onLoad: null,
                onFail: null,
                callback: null
            }, x = {handle: {}, on: f, off: h, refresh: l, modify: d, widget: c, option: u, config: k, init: i},
            k = x.config = t.extend(!0, {}, y, e.config.list, n), T = k.page, C = {}, S = !1, O = k.data;
        return i(k), x
    }, e
}(bui || {}, libs), function (e, t) {
    return e.searchbar = function (n) {
        function i(n) {
            var i = t.extend(!0, m, n);
            return d = e.obj(i.id), m = v.config = i, h = d.find("input"), d.find(i.handleRemove).length > 0 ? p : h.after('<i class="' + i.handleRemove.substr(1) + '"></i>'), p = d.find(i.handleRemove), p.hide(), b || a(i), this
        }

        function a(n) {
            return d.on("click.bui", n.handle, function (e) {
                document.activeElement.blur();
                var t = h.val();
                f = t, u.call(this, "search", t), n.callback && n.callback.call(this, v, t)
            }), d.on("click.bui", n.handleRemove, function () {
                document.activeElement.blur(), h.val("");
                var e = h.val();
                f = e, t(this).hide(), u.call(this, "remove", e), n.onRemove && n.onRemove.call(this, v, e)
            }), d.on("input", "input", e.unit.debounce(function () {
                var e = h.val();
                f = e, e ? p.show() : p.hide(), u.call(this, "input", e), n.onInput && n.onInput.call(this, v, e)
            }, n.delayTime)), b = !0, this
        }

        function r(e) {
            return e = e || f, u.call(this, "search", e), m.callback && m.callback.call(this, v, e), this
        }

        function o(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function l(t, n) {
            return e.option.call(v, t, n)
        }

        function s(t, n) {
            return e.on.apply(v, arguments), this
        }

        function c(t, n) {
            return e.off.apply(v, arguments), this
        }

        function u(t) {
            v.self = this == window || this == v ? null : this, e.trigger.apply(v, arguments)
        }

        var d, f, h, p, g = {
                id: "",
                handle: ".icon-search,.btn-search",
                handleRemove: ".icon-remove",
                delayTime: 400,
                onInput: null,
                onRemove: null,
                callback: null
            }, v = {handle: {}, on: s, off: c, search: r, widget: o, option: l, config: m, init: i},
            m = v.config = t.extend(!0, {}, g, e.config.searchbar, n), b = !1;
        return i(m), v
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.select = function (n) {
        function i(n) {
            var i = t.extend(!0, N, n);
            if (O = [], I = [], D = i.id ? e.obj(i.id).attr("id") : D, N = F.config = i, i.data.length) var l = o(i.data);
            if (i.popup) if (j) j.close(), T.find(".bui-dialog-main").html(l); else {
                if (i.id) T = e.obj(i.id); else {
                    var c = r();
                    t("body").append(c), T = e.obj(D), T.find(".bui-dialog-main").html(l)
                }
                j = e.dialog({
                    id: D,
                    effect: i.effect,
                    mask: i.mask,
                    position: i.position,
                    autoClose: !1,
                    height: i.height,
                    width: i.width,
                    zoom: !1,
                    fullscreen: i.fullscreen,
                    onMask: function (e) {
                        s()
                    }
                })
            } else {
                if (!i.id) return void e.hint("select id 必须有");
                T = e.obj(i.id), i.data.length && T.empty().html(l)
            }
            return E = T.find(i.handle), P || a(i), this
        }

        function a(n) {
            n.trigger && (k = e.obj(n.trigger), S = k.find(n.triggerChildren).length ? k.find(n.triggerChildren) : k, C = n.title || t.trim(S.html()), n.title && S.html(n.title), k.on("click.bui", function (e) {
                t(this).hasClass("disabled") || l()
            })), w("change", function () {
                var i = t(this), a = i.val(), r = i.attr("text"), o = i.is(":checked");
                switch (n.type) {
                    case"radio":
                        O = [], I = [], O.push(r), I.push(a), c(a || ""), u(r || C || "");
                        break;
                    case"select":
                        O = [], I = [], O.push(r), I.push(a), c(a || ""), u(r || C || "");
                        break;
                    case"checkbox":
                        var l = T.attr("value"), s = T.attr("text");
                        if (l && l.indexOf(",") > -1) try {
                            I = l.split(","), O = s && s.split(",") || []
                        } catch (d) {
                        }
                        o ? (O.push(r), I.push(a)) : (e.removeArray(a, I), e.removeArray(r, O)), c(I.join(",") || ""), u(O.join(",") || "")
                }
            });
            var i = function (e) {
                var i = this, a = t(i).find("input"), r = (a.val(), t(i).index()),
                    o = (a.attr("text"), a.is(":checked"));
                e.srcElement = e.originalEvent && e.originalEvent.srcElement || e.srcElement, a.length && "INPUT" !== e.srcElement.nodeName && (o ? o && "checkbox" == n.type && (a.prop("checked", !1), x.call(a, "uncheck", e)) : (a.prop("checked", !0), x.call(a, "check", e))), a.length && "INPUT" === e.srcElement.nodeName && (o || "checkbox" != n.type ? o && "checkbox" == n.type ? x.call(a, "check", e) : "radio" == n.type && x.call(a, "check", e) : x.call(a, "uncheck", e)), x.call(a, "change", e), x.call(a, "select", e), n.popup && n.autoClose && s(), n.onChange && n.onChange.call(a, F, r), e.stopPropagation()
            }, a = function (e) {
                n.callback && n.callback.call(this, F), e.stopPropagation()
            };
            T.on("click", n.handle, i), T.on("click.bui", n.callbackHandle, a), P = !0
        }

        function r(e) {
            var n = "";
            return N.popup && (n += '<div id="' + D + '" class="bui-dialog bui-dialog-select">', N.title && (n += '<div class="bui-dialog-head">' + N.title + "</div>"), n += '  <div class="bui-dialog-main">'), N.popup && (n += "  </div>", N.buttons.length > 0 && (n += '    <div class="bui-dialog-foot bui-box">', t.each(N.buttons, function (e, t) {
                n += '        <div class="span1">', n += '             <div class="bui-btn ' + (t.className || "") + '" value="' + (t.value || "") + '">' + (t.name || t) + "</div>", n += "        </div>"
            }), n += "    </div>"), n += "</div>"), n
        }

        function o(n) {
            var i = e.guid(), a = "";
            return a += '    <div class="bui-list">', t.each(n, function (e, t) {
                var n = "string" == typeof t ? t : t.name || "", r = t && t.value ? t.value : e, o = "";
                "checkbox" == N.type ? o = '        <input type="checkbox" class="' + (N.className || "bui-checkbox") + '" name="' + i + '" value="' + r + '" text="' + n + '">' : "radio" == N.type ? o = '        <input type="radio" class="' + (N.className || "bui-checkbox") + '" name="' + i + '" value="' + r + '" text="' + n + '">' : "select" == N.type && (o = '        <input type="radio" class="' + (N.className || "bui-choose") + '" name="' + i + '" value="' + r + '" text="' + n + '">'), a += '    <div class="bui-btn bui-box bui-btn-line">', "left" == N.direction && (a += o), "center" == N.direction ? (a += '        <div class="span1" align="center">' + n + "</div>", a += o) : a += '        <div class="span1">' + n + "</div>", "right" == N.direction && (a += o), a += "    </div>"
            }), a += "    </div>"
        }

        function l(e) {
            return x.call(this, "showbefore"), N.popup && j ? !j.isOpen() && j.open(function () {
                e && e.call(F), x.call(this, "show")
            }) : (T.css("display", "block"), e && e.call(F), x.call(this, "show")), this
        }

        function s(e) {
            return x.call(this, "hidebefore"), N.popup && j ? j.isOpen() && j.close(function () {
                e && e.call(F), x.call(this, "hide")
            }) : (T.css("display", "none"), e && e.call(F), x.call(this, "hide")), this
        }

        function c(n) {
            if (!n && "" != n) {
                var i = T.attr("value");
                return i
            }
            var a = [];
            O = [], I = [], n.indexOf(",") > -1 ? a = n.split(",") : a.push(n), T.find(N.handle).each(function (n, i) {
                var r = t(this).find("input");
                if (!(r.length < 1)) {
                    var o = r.val(), l = r.attr("text");
                    e.compareArray(o, a) && (O.push(l), I.push(o), r.attr("checked", "checked"))
                }
            }), k && N.change && k.attr("value", I.join(",")), T.attr("value", I.join(","))
        }

        function u(e) {
            if (!e && "" != e) {
                var e = T.attr("text");
                return e
            }
            k && N.change && (k.attr("text", e), S.html(e || C)), T.attr("text", e)
        }

        function d(e) {
            var n = [];
            String(e).indexOf(",") > -1 ? n = e.split(",") : n.push(parseInt(e)), O = [], I = [], t.each(n, function (e, t) {
                var n = E.eq(t), i = n.find("input"), a = i.val(), r = i.attr("text");
                (r || a) && (O.push(r), I.push(a))
            }), "checkbox" == N.type ? (u(O.join(",")), c(I.join(","))) : (u(O[0]), c(I[0])), x.call(this, "change")
        }

        function f() {
            if ("radio" != N.type || "select" != N.type) {
                var e = [], n = [];
                T.find("input").each(function (i, a) {
                    var r = t(this), o = r.val(), l = r.attr("text");
                    e.push(l), n.push(o), r.prop("checked", !0)
                }), c(n.join(",") || ""), u(e.join(",") || "")
            }
            return this
        }

        function h() {
            return T.find("input").prop("checked", null), c(""), u(""), x.call(this, "reset"), this
        }

        function p(e) {
            if ("radio" != N.type || "select" != N.type) {
                var n = [], i = [];
                T.find("input").each(function (e, a) {
                    var r = t(this).is(":checked"), o = t(this).val(), l = t(this).attr("text");
                    r ? t(this).prop("checked", null) : (t(this).prop("checked", !0), n.push(l), i.push(o))
                }), c(i.join(",") || ""), u(n.join(",") || "")
            }
        }

        function g() {
            var e = k;
            return e && e.addClass("disabled"), this
        }

        function v() {
            var e = k;
            return e && e.removeClass("disabled"), this
        }

        function m(t) {
            var n = {dialog: j || {}};
            return e.widget.call(n, t)
        }

        function b(t, n) {
            return e.option.call(F, t, n)
        }

        function w(t, n) {
            return e.on.apply(F, arguments), this
        }

        function y(t, n) {
            return e.off.apply(F, arguments), this
        }

        function x(t) {
            F.self = this == window || this == F ? null : this, e.trigger.apply(F, arguments)
        }

        var k, T, C, S, O, I, E, j, L = {
            id: "",
            trigger: "",
            triggerChildren: ".span1",
            handle: ".bui-list .bui-btn",
            className: "",
            data: [],
            popup: !0,
            title: "",
            autoClose: !1,
            height: 0,
            width: 0,
            mask: !0,
            change: !0,
            effect: "fadeInUp",
            type: "radio",
            direction: "left",
            position: "bottom",
            fullscreen: !1,
            buttons: [],
            onChange: null,
            callbackHandle: ".bui-dialog-foot .bui-btn",
            callback: null
        }, F = {
            handle: {},
            on: w,
            off: y,
            value: c,
            active: d,
            disabled: g,
            enabled: v,
            text: u,
            show: l,
            hide: s,
            selectAll: f,
            selectNone: h,
            unselect: p,
            widget: m,
            option: b,
            config: N,
            init: i
        }, N = F.config = t.extend(!1, {}, L, e.config.select, n), D = e.guid(), P = !1;
        return i(N), F
    }, e
}(bui || {}, libs), function (e) {
    "use strict";
    return e.dropdown = function (t) {
        function n(t) {
            var n = $.extend(!0, O, t);
            if (!n.id) return void e.showLog("dropdown id不能为空", "bui.dropdown.init");
            b = e.obj(n.id), O = S.config = n, w = b.children(n.handle), T = n.target ? b.children(n.target) : w.next(), x = n.relative, y = b.attr("position") || n.position;
            var r = b.offset() && b.offset().left >= document.documentElement.clientWidth ? 0 : b.offset() && b.offset().left,
                l = n.width ? "auto" : -r + "px", s = {
                    bottom: {menuPosition: "bui-menu-bottom", arrowPosition: "bui-arrow-up", left: l},
                    top: {menuPosition: "bui-menu-top", arrowPosition: "bui-arrow-down", left: l},
                    left: {menuPosition: "bui-menu-left", arrowPosition: "bui-arrow-right", left: "auto"},
                    right: {menuPosition: "bui-menu-right", arrowPosition: "bui-arrow-left", left: "100%"}
                };
            k = n.width > 0 ? n.width : x ? I : n.width, parseFloat(k) > 0 && T.width(k);
            var c = n.showArrow ? s[y].arrowPosition + " " + s[y].menuPosition : s[y].menuPosition;
            a(c, s[y].left);
            var u = T.find(".active").eq(0), d = u.index();
            return d >= 0 && o(d), E || i(n), this
        }

        function i(e) {
            var t = function (e) {
                if (!$(this).hasClass("disabled")) {
                    var t = $(this).hasClass("active");
                    u(), t ? s() : c(), e.stopPropagation()
                }
            }, n = function (t) {
                var n = $(this).attr("value") || "", i = $.trim($(this).text()),
                    a = void 0 != b.attr("change") ? b.attr("change") : e.change;
                e.showActive && $(this).addClass("active").siblings().removeClass("active"), r.call(this, n), 1 == a && l.call(this, i), s(), e.callback && e.callback.call(this, S, i, n)
            };
            w.on("click.bui", t), b.on("click.bui", e.targetHandle, n);
            var i = function (e) {
                u(), e.stopPropagation()
            };
            $("body").on("click.bui", ":not(.bui-dropdown)", i), E = !0
        }

        function a(e, t) {
            T.addClass(e), x && T.css({left: t})
        }

        function r(e) {
            if (void 0 == e) {
                var t = w.attr("value");
                return t
            }
            w.attr("value", e), O.change || m.call(this, "change", {currentTarget: w})
        }

        function o(e) {
            e = parseInt(e);
            var t = T.find(O.targetHandle).eq(e);
            if (t.length > 0) {
                var n = $.trim(t.text()), i = t.attr("value") || "";
                l(n), r(i), O.showActive && t.addClass("active").siblings().removeClass("active")
            }
        }

        function l(e) {
            if (void 0 == e) {
                var t = $.trim(w.text());
                return t
            }
            var n = w.children(O.handleChildren);
            n ? n.text(e) : w.text(e), m.call(this, "change", {currentTarget: w})
        }

        function s() {
            w.removeClass("active"), T.css("display", "none"), m.call(this, "hide", {currentTarget: w})
        }

        function c() {
            w.addClass("active"), T.css("display", "block"), m.call(this, "show", {currentTarget: w})
        }

        function u() {
            $(".bui-dropdown > .bui-btn").removeClass("active"), $(".bui-dropdown > .bui-list").css("display", "none"), m.call(this, "hide", {currentTarget: w})
        }

        function d() {
            var e = w;
            return e && e.addClass("disabled"), this
        }

        function f() {
            var e = w;
            return e && e.removeClass("disabled"), this
        }

        function h(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function p(t, n) {
            return e.option.call(S, t, n)
        }

        function g(t, n) {
            return e.on.apply(S, arguments), this
        }

        function v(t, n) {
            return e.off.apply(S, arguments), this
        }

        function m(t) {
            S.self = this == window || this == S ? null : this, e.trigger.apply(S, arguments)
        }

        var b, w, y, x, k, T, C = {
            id: "", handle: ".bui-btn", handleChildren: ".span1", target: "", targetHandle: ".bui-btn",
            position: "bottom", showArrow: !1, showActive: !0, width: 0, relative: !0, change: !0, callback: null
        }, S = {
            handle: {},
            on: g,
            off: v,
            active: o,
            disabled: d,
            enabled: f,
            value: r,
            text: l,
            hide: s,
            show: c,
            hideAll: u,
            widget: h,
            option: p,
            config: O,
            init: n
        }, O = S.config = $.extend(!0, {}, C, e.config.dropdown, t), I = document.documentElement.clientWidth, E = !1;
        return n(O), S
    }, e
}(bui || {}), function (e, t) {
    "use strict";
    return e.accordion = function (n) {
        function i(n) {
            var i = t.extend(!0, O, n);
            return y = document.documentElement.clientWidth, x = document.documentElement.clientHeight, I = e.obj(i.id) || t("." + e.prefix("accordion")), O = S.config = i, k = i.handle.indexOf("#") > -1 ? e.obj(i.handle) : I.children(i.handle), T = i.target.indexOf("#") > -1 ? e.obj(i.target) : I.children(i.target), a(i), E || r(i), this
        }

        function a(e) {
            k.removeClass("active"), T.css("display", "none"), parseFloat(e.targetHeight) > 0 && T.height(e.targetHeight), parseFloat(e.height) > 0 && I.height(e.height)
        }

        function r(e) {
            var n = (x - t("header").height() - t("footer").height(), function (n) {
                t(this).hasClass("disabled") || t(this).attr("href") || (s.call(this, e), e.callback && e.callback.call(this, S), !t(this).attr("href") && n.stopPropagation())
            });
            e.handle.indexOf("#") > -1 ? k.on("click.bui", n) : I.on("click.bui", e.handle, n), E = !0
        }

        function o(e) {
            var t;
            return t = "number" == typeof e ? k.eq(e) : k, t && t.addClass("disabled"), this
        }

        function l(e) {
            var t;
            return t = "number" == typeof e ? k.eq(e) : k, t && t.removeClass("disabled"), this
        }

        function s(n) {
            var i = t(this), a = i.hasClass("active"),
                r = (k.index(this), n.target.indexOf("#") > -1 ? e.obj(n.target) : i.next(n.target));
            n.single ? a ? (i.removeClass("active"), r.css("display", "none"), w.call(S, "hide", {currentTarget: i})) : (p(), i.addClass("active"), r.css("display", "block"), w.call(S, "show", {currentTarget: i})) : a ? (i.removeClass("active"), r.css("display", "none"), w.call(S, "hide", {currentTarget: i})) : (i.addClass("active"), r.css("display", "block"), w.call(S, "show", {currentTarget: i}))
        }

        function c(e) {
            var e = Number(e) || 0, t = k.eq(e).length ? k.eq(e) : k, n = T.eq(e).length ? T.eq(e) : t.next(O.target);
            return t.addClass("active"), n.css("display", "block"), w.call(this, "show", {currentTarget: k[e]}), this
        }

        function u(e) {
            var e = Number(e) || 0, t = k.eq(e).length ? k.eq(e) : k, n = T.eq(e).length ? T.eq(e) : t.next(O.target);
            return t.removeClass("active"), n.css("display", "none"), w.call(this, "hide", {currentTarget: k[e]}), this
        }

        function d() {
            return I.length > 1 ? I.each(function (e, t) {
                f(0, t)
            }) : f(0), w.call(this, "show", {currentTarget: k[0]}), this
        }

        function f(e, n) {
            var e = e || 0, i = n ? t(n) : I;
            i.children(O.handle).eq(e).addClass("active").next(O.target).css("display", "block")
        }

        function h() {
            return k.each(function (e, n) {
                t(n).addClass("active").next(O.target).css("display", "block")
            }), w.call(this, "showall", {currentTarget: k}), this
        }

        function p() {
            return k.each(function (e, n) {
                t(n).removeClass("active").next(O.target).css("display", "none")
            }), w.call(this, "hideall", {currentTarget: k}), this
        }

        function g(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function v(t, n) {
            return e.option.call(S, t, n)
        }

        function m(t, n) {
            return e.on.apply(S, arguments), this
        }

        function b(t, n) {
            return e.off.apply(S, arguments), this
        }

        function w(t) {
            S.self = this == window || this == S ? null : this, e.trigger.apply(S, arguments)
        }

        var y, x, k, T,
            C = {id: "", handle: "dt", target: "dd", height: 0, targetHeight: 0, single: !1, callback: null}, S = {
                handle: {},
                on: m,
                off: b,
                showFirst: d,
                showAll: h,
                hideAll: p,
                disabled: o,
                enabled: l,
                show: c,
                hide: u,
                widget: g,
                option: v,
                config: O,
                init: i
            }, O = S.config = t.extend(!0, {}, C, e.config.accordion, n), I = e.obj(O.id), E = !1;
        return i(O), S
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.rating = function (n) {
        function i(n) {
            var i = t.extend(!0, S, n);
            return i.id ? (b = e.obj(i.id), S = C.config = i, w = i.fullClassName, y = i.halfClassName, l(i), O || o(i), this) : void e.hint("rating id不能为空")
        }

        function a(t) {
            var n = (e.guid(), ""), i = 0, a = t.stars;
            for (i = 0; a > i; i++) n += '<div class="bui-rating-cell" ></div>';
            return n
        }

        function r(e) {
            var t, n = "", e = String(e) || String(x), i = 0, a = S.stars, r = [];
            r = e.indexOf(".") > -1 ? e.split(".") : [e, 0];
            var o = parseInt(r[0]);
            for (t = r[1] / 10 * 100 + "%", i = 0; a > i; i++) o > i && (n += '<div class="bui-rating-cell" ><div class="bui-rating-cell-full" style="width:100%;">&nbsp;</div></div>'), i == o && (n += '<div class="bui-rating-cell" ><div class="bui-rating-cell-full" style="width:' + t + ';">&nbsp;</div></div>'), i > o && (n += '<div class="bui-rating-cell" ><div class="bui-rating-cell-full" style="width:0;">&nbsp;</div></div>');
            return n
        }

        function o(e) {
            if (!e.disabled) {
                var n = String(e.value).indexOf(".") > -1 ? 1 : 0;
                b.on("click.bui", e.handle, function (i) {
                    var a = t(this).index(), r = 0;
                    if (e.half) {
                        r = n % 2 == 0 ? a + .5 : a + 1
                    } else r = a + 1;
                    s(r), c(r), n++, e.callback && e.callback.call(this, C), i.stopPropagation()
                })
            }
            O = !0
        }

        function l(e) {
            if (e.render) {
                var t = a(e);
                b.html(t), k = b.find(e.handle)
            } else k = b.find(e.handle);
            c(e.value)
        }

        function s(e) {
            var n = [];
            e = String(e), S.half && e.indexOf(".") > -1 ? n = e.split(".") : n.push(e), k.removeClass(w).removeClass(y), k.each(function (e, i) {
                1 == n.length && e < n[0] ? t(i).addClass(w) : 2 == n.length && (e < n[0] && t(i).addClass(w), e == n[0] && t(i).addClass(y))
            })
        }

        function c(e) {
            return e ? (b.attr("value", e), s(e), x = e, m.call(this, "change", e)) : x = b.attr("value"), x
        }

        function u(e) {
            var t = r(e);
            b.attr("value", e).html(t), x = e
        }

        function d(e) {
            var e = 0 != e;
            return e ? (b.off("click.bui", S.handle), m.call(this, "disabled")) : f(), this
        }

        function f(e) {
            return S.disabled = !1, o(), m.call(this, "undisabled"), this
        }

        function h(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function p(t, n) {
            return e.option.call(C, t, n)
        }

        function g(t, n) {
            return e.on.apply(C, arguments), this
        }

        function v(t, n) {
            return e.off.apply(C, arguments), this
        }

        function m(t) {
            C.self = this == window || this == C ? null : this, e.trigger.apply(C, arguments)
        }

        var b, w, y, x, k, T = {
                id: "",
                handle: ".bui-rating-cell",
                fullClassName: "bui-rating-cell-full",
                halfClassName: "bui-rating-cell-half",
                half: !1,
                stars: 5,
                value: 0,
                disabled: !1,
                render: !0,
                callback: null
            }, C = {handle: {}, on: g, off: v, disabled: d, show: u, value: c, widget: h, option: p, config: S, init: i},
            S = C.config = t.extend(!0, {}, T, e.config.rating, n), O = !1;
        return i(S), C
    }, e
}(bui || {}, libs), function (e) {
    "use strict";
    return e.actionsheet = function (t) {
        function n(t) {
            var n = $.extend(!0, x, t);
            v = e.obj(n.trigger), x = y.config = n, m = e.guid();
            var o = a(n.buttons);
            return $(n.appendTo).append(o), p = e.dialog({
                id: m,
                position: n.position,
                mask: n.mask,
                opacity: n.opacity,
                onMask: function (e) {
                    r()
                }
            }), b = e.obj(m), g = b.find(n.handle), k || i(), this
        }

        function i() {
            var e = function (e) {
                x.callback && x.callback.call(this, e, y), h.call(this, "click", e)
            }, t = function (e) {
                $(this).hasClass("disabled") || o.call(this)
            };
            b.on("click.bui", x.handle, e), v.on("click.bui", t), k = !0
        }

        function a(e) {
            var t = parseFloat(x.width),
                n = t > 0 ? "width:" + t + "px;left:50%;right:0;margin-left:-" + t / 2 + "px;" : "", i = "";
            return e && e.length && (i += '<div id="' + m + '" class="bui-actionsheet" style="' + n + '">', i += '    <ul class="bui-list round">', $.each(e, function (e, t) {
                i += '        <li class="bui-btn ' + (t.className || "") + '" value="' + (t.value || "") + '">' + (t.name || "") + "</li>"
            }), i += "    </ul>", x.cancelText ? i += '    <div class="bui-btn round" value="cancel">' + x.cancelText + "</div>" : "", i += "</div>"), i
        }

        function r(e) {
            var t = this;
            return h.call(t, "hidebefore", {currentTarget: p}), p.isOpen() && p.close(function () {
                e && e.call(y), h.call(t, "hide", {currentTarget: p})
            }), this
        }

        function o(e) {
            var t = this;
            return h.call(t, "showbefore", {currentTarget: p}), !p.isOpen() && p.open(function () {
                e && e.call(y), h.call(t, "show", {currentTarget: p})
            }), this
        }

        function l(e) {
            var t = v;
            return t && t.addClass("disabled"), this
        }

        function s() {
            var e = v;
            return e && e.removeClass("disabled"), this
        }

        function c(t) {
            var n = {dialog: p};
            return e.widget.call(n, t)
        }

        function u(t, n) {
            return e.option.call(y, t, n)
        }

        function d(t, n) {
            return e.on.apply(y, arguments), this
        }

        function f(t, n) {
            return e.off.apply(y, arguments), this
        }

        function h(t) {
            y.self = this == window || this == y ? null : this, e.trigger.apply(y, arguments)
        }

        var p, g, v, m, b, w = {
            appendTo: "body",
            trigger: "",
            handle: ".bui-btn",
            position: "bottom",
            width: 0,
            mask: !0,
            opacity: .6,
            buttons: [],
            cancelText: "取消",
            callback: null
        }, y = {
            handle: {},
            on: d,
            off: f,
            disabled: l,
            enabled: s,
            hide: r,
            show: o,
            widget: c,
            option: u,
            config: x,
            init: n
        }, x = y.config = $.extend(!1, {}, w, e.config.actionsheet, t), k = !1;
        return n(x), y
    }, e
}(bui || {}), function (e, t) {
    return e.number = function (n) {
        function i(n) {
            var i = t.extend(!0, I, n);
            return b = i.max, w = i.min, y = i.step, i.id ? (C = e.obj(i.id), I = O.config = i, i.render && r(i), x = C.children(i.prev), k = C.children(i.next), T = C.children(i.input), L || o(i), w > b ? void e.hint("min值 不能大于 max值 ") : (i.disabled && T.attr({disabled: "disabled"}), s(i.value), this)) : void e.hint("number id不能为空")
        }

        function a(e) {
            var t = "";
            return t += '    <div class="bui-number-prev">-</div>', t += '    <input type="text" value="' + e.value + '"/>', t += '    <div class="bui-number-next">+</div>'
        }

        function r(e) {
            var t = a(e);
            return C.html(t), this
        }

        function o(e) {
            return C.on("input", e.input, function (e) {
                var n = isNaN(parseInt(t(this).val())) ? 0 : parseInt(t(this).val());
                /^[0-9]*$/i.test(n) && s(n), e.stopPropagation()
            }), C.on("click.bui", e.prev, function (t) {
                d.call(this, t), e.callback && e.callback.call(this, t, O)
            }), C.on("click.bui", e.next, function (t) {
                f.call(this, t), e.callback && e.callback.call(this, t, O)
            }), L = !0, this
        }

        function l() {
            var e = parseInt(T.val());
            return e
        }

        function s(t) {
            return value = t || 0, value > b && (I.tips && e.hint("输入的值大于最大值"), j = !1, E = !0), value < w && (I.tips && e.hint("输入的值小于最小值"), j = !0, E = !1), value && value >= w && value <= b && (value = value), m.call(this, "change", parseInt(value)), T.val(parseInt(value)), this
        }

        function c(e) {
            var t = 0;
            return e ? (s(e), t = e) : t = l(), t
        }

        function u(e) {
            var e = 0 != e;
            return e ? T.attr({disabled: "disabled"}) : T.removeAttr("disabled"), this
        }

        function d() {
            if (!j) {
                var e = T.val(), t = parseInt(e);
                if (t > w) {
                    var n = t -= y;
                    t = n > w ? n : w
                } else t = w;
                s(t), m.call(this, "prev", t)
            }
            return this
        }

        function f() {
            if (!E) {
                var e = T.val(), t = parseInt(e);
                if (b > t) {
                    var n = t += y;
                    t = b > n ? n : b
                } else t = b;
                s(t), m.call(this, "next", t)
            }
            return this
        }

        function h(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function p(t, n) {
            return e.option.call(O, t, n)
        }

        function g(t, n) {
            return e.on.apply(O, arguments), this
        }

        function v(t, n) {
            return e.off.apply(O, arguments), this
        }

        function m(t) {
            O.self = this == window || this == O ? null : this, e.trigger.apply(O, arguments)
        }

        var b, w, y, x, k, T, C, S = {
            id: null,
            min: 0,
            max: 100,
            step: 1,
            value: 0,
            disabled: !1,
            render: !0,
            tips: !0,
            prev: ".bui-number-prev",
            input: "input",
            next: ".bui-number-next",
            callback: null
        }, O = {
            handle: {},
            on: g,
            off: v,
            disabled: u,
            value: c,
            prev: d,
            next: f,
            widget: h,
            option: p,
            config: I,
            init: i
        }, I = O.config = t.extend(!0, {}, S, e.config.number, n), E = !1, j = !1, L = !1;
        return i(I), O
    }, e
}(bui || {}, libs), function (e, t) {
    "use strict";
    return e.stepbar = function (n) {
        function i(n) {
            var i = t.extend(!0, b, n);
            if (!i.id) return void e.hint("stepbar id不能为空");
            p = e.obj(i.id), b = m.config = i;
            var o = a(i.data);
            return t(i.id).html(o), g = p.children(), w || r(i), this
        }

        function a(e) {
            var n = "";
            return t.each(e, function (e, t) {
                n += '<div class="bui-stepbar-cell">', n += '    <span class="bui-stepbar-dot"></span>', n += '    <div class="bui-stepbar-text">', t.title && (n += "        <h3>" + t.title + "</h3>"), t.subtitle && (n += '        <p class="bui-stepbar-time">' + t.subtitle + "</p>"), t.content && (n += '        <p class="bui-stepbar-desc">' + t.content + "</p>"), n += "    </div>", n += "</div>"
            }), n
        }

        function r(e) {
            var n = function (n) {
                if (e.click) {
                    var i = t(this).index();
                    o(i)
                }
                e.callback && e.callback.call(this, n, m)
            };
            return p.on("click.bui", e.handle, n), w = !0, this
        }

        function o(e) {
            if ("number" == typeof e) return e = e >= g.length - 1 ? g.length - 1 : 0 > e ? 0 : e, g.each(function (n, i) {
                e > n && t(i).removeClass("active").addClass("visited"), n == e && t(i).removeClass("visited").addClass("active"), n > e && t(i).removeClass("visited active")
            }), h.call(this, "change", e), e;
            var e = p.children(".active").index();
            return e
        }

        function l() {
            var e = o() + 1;
            return h.call(this, "next", e), o(e)
        }

        function s() {
            var e = o() - 1;
            return h.call(this, "prev", e), o(e)
        }

        function c(t) {
            var n = {};
            return e.widget.call(n, t)
        }

        function u(t, n) {
            return e.option.call(m, t, n)
        }

        function d(t, n) {
            return e.on.apply(m, arguments), this
        }

        function f(t, n) {
            return e.off.apply(m, arguments), this
        }

        function h(t) {
            m.self = this == window || this == m ? null : this, e.trigger.apply(m, arguments)
        }

        var p, g, v = {id: null, handle: ".bui-stepbar-cell", click: !0, data: [], callback: null},
            m = {handle: {}, on: d, off: f, value: o, next: l, prev: s, widget: c, option: u, config: b, init: i},
            b = m.config = t.extend(!0, {}, v, e.config.stepbar, n), w = !1;
        return i(b), m
    }, e
}(bui || {}, libs);
var Picker = function (e) {
    function t(e) {
        return window.cancelAnimationFrame ? window.cancelAnimationFrame(e) : window.webkitCancelAnimationFrame ? window.webkitCancelAnimationFrame(e) : window.mozCancelAnimationFrame ? window.mozCancelAnimationFrame(e) : window.clearTimeout(e)
    }

    function n(e, t) {
        for (var n = 0; n < e.length; n++) {
            var i = e[n].style;
            i.webkitTransform = i.MsTransform = i.msTransform = i.MozTransform = i.OTransform = i.transform = t
        }
        return e
    }

    function i(e, t) {
        "string" != typeof t && (t += "ms");
        for (var n = 0; n < e.length; n++) {
            var i = e[n].style;
            i.webkitTransitionDuration = i.MsTransitionDuration = i.msTransitionDuration = i.MozTransitionDuration = i.OTransitionDuration = i.transitionDuration = t
        }
        return e
    }

    function a(e, t) {
        var n, i, a, r;
        return "undefined" == typeof t && (t = "x"), a = window.getComputedStyle(e, null), window.WebKitCSSMatrix ? (i = a.transform || a.webkitTransform, i.split(",").length > 6 && (i = i.split(", ").map(function (e) {
            return e.replace(",", ".")
        }).join(", ")), r = new WebKitCSSMatrix("none" === i ? "" : i)) : (r = a.MozTransform || a.OTransform || a.MsTransform || a.msTransform || a.transform || a.getPropertyValue("transform").replace("translate(", "matrix(1, 0, 0, 1,"), n = r.toString().split(",")), "x" === t && (i = window.WebKitCSSMatrix ? r.m41 : 16 === n.length ? parseFloat(n[12]) : parseFloat(n[4])), "y" === t && (i = window.WebKitCSSMatrix ? r.m42 : 16 === n.length ? parseFloat(n[13]) : parseFloat(n[5])), i || 0
    }

    var r = this, o = {updateValuesOnTouchmove: !1, rotateEffect: !1, momentumRatio: 7, freeMode: !1};
    e = e || {};
    for (var l in o) "undefined" == typeof e[l] && (e[l] = o[l]);
    r.params = e, r.cols = [], r.initialized = !1;
    var s = function () {
        var e = navigator.userAgent, t = e.match(/(Android);?[\s\/]+([\d.]+)?/), n = e.match(/(iPad).*OS\s([\d_]+)/),
            i = e.match(/(iPod)(.*OS\s([\d_]+))?/), a = !n && e.match(/(iPhone\sOS)\s([\d_]+)/), r = n || i || a,
            o = !!t;
        return r || navigator.userAgent.toLowerCase().indexOf("safari") >= 0 && navigator.userAgent.toLowerCase().indexOf("chrome") < 0 && !o
    }();
    return r.setValue = function (e, t) {
        var n = 0;
        if (0 === r.cols.length) return r.value = e, void r.updateValue(e);
        for (var i = 0; i < r.cols.length; i++) r.cols[i] && !r.cols[i].divider && (r.cols[i].setValue(e[n], t), n++)
    }, r.updateValue = function (e) {
        for (var t = e || [], n = [], i = 0; i < r.cols.length; i++) r.cols[i].divider || (t.push(r.cols[i].value), n.push(r.cols[i].displayValue));
        t.indexOf(void 0) >= 0 || (r.value = t, r.displayValue = n, r.params.onChange && r.params.onChange(r, r.value, r.displayValue))
    }, r.initPickerCol = function (e, o) {
        function l(e) {
            if (!k && !x) {
                var t = e.originalEvent || e;
                t.preventDefault(), x = !0, T = C = t.targetTouches[0].pageY, S = (new Date).getTime(), D = !0, I = j = a(p.wrapper[0], "y")
            }
        }

        function c(e) {
            if (x) {
                var o = e.originalEvent || e;
                o.preventDefault(), D = !1, C = o.targetTouches[0].pageY, k || (t(y), k = !0, I = j = a(p.wrapper[0], "y"), i(p.wrapper, "0ms")), o.preventDefault();
                var l = C - T;
                j = I + l, E = void 0, b > j && (j = b - Math.pow(b - j, .8), E = "min"), j > w && (j = w + Math.pow(j - w, .8), E = "max"), n(p.wrapper, "translate3d(0," + j + "px,0)"), p.updateItems(void 0, j, 0, r.params.updateValuesOnTouchmove), F = j - L || j, N = (new Date).getTime(), L = j
            }
        }

        function u(e) {
            if (!x || !k) return void (x = k = !1);
            x = k = !1, i(p.wrapper, ""), E && ("min" === E ? n(p.wrapper, "translate3d(0," + b + "px,0)") : n(p.wrapper, "translate3d(0," + w + "px,0)")), O = (new Date).getTime();
            var t, a;
            O - S > 300 ? a = j : (t = Math.abs(F / (O - N)), a = j + F * r.params.momentumRatio), a = Math.max(Math.min(a, w), b);
            var o = -Math.floor((a - w) / v);
            r.params.freeMode || (a = -o * v + w), n(p.wrapper, "translate3d(0," + parseInt(a, 10) + "px,0)"), p.updateItems(o, a, "", !0), setTimeout(function () {
                D = !0
            }, 100)
        }

        function d(e) {
            if (D) {
                t(y);
                var n = $(this).attr("data-picker-value");
                p.setValue(n)
            }
        }

        var f = $(e), h = f.index(), p = r.cols[h];
        if (!p.divider) {
            p.container = f, p.wrapper = p.container.find(".picker-items-col-wrapper"), p.items = p.wrapper.find(".picker-item");
            var g, v, m, b, w;
            p.replaceValues = function (e, t, n) {
                p.destroyEvents(), p.values = e, p.displayValues = t;
                var i = r.columnHTML(p, !0);
                p.wrapper.html(i), p.items = p.wrapper.find(".picker-item"), p.calcSize(), p.setValue(n || p.values[0], 0, !0), p.initEvents()
            }, p.calcSize = function () {
                r.params.rotateEffect && (p.container.removeClass("picker-items-col-absolute"), p.width || (p.container[0].style.width = ""));
                var e, t;
                e = 0, t = p.container[0].offsetHeight, g = p.wrapper[0].offsetHeight, v = p.items[0].offsetHeight, m = v * p.items.length, b = t / 2 - m + v / 2, w = t / 2 - v / 2, p.width && (e = p.width, parseInt(e, 10) === e && (e += "px"), p.container[0].style.width = e), r.params.rotateEffect && (p.width || (p.items.each(function () {
                    var t = $(this);
                    t[0].style.width = "auto", e = Math.max(e, t[0].offsetWidth), t[0].style.width = ""
                }), p.container[0].style.width = e + 2 + "px"), p.container.addClass("picker-items-col-absolute"))
            }, p.calcSize(), n(p.wrapper, "translate3d(0," + w + "px,0)"), i(p.wrapper, "0ms");
            var y;
            p.setValue = function (e, t, a) {
                "undefined" == typeof t && (t = "");
                var r = p.wrapper.find('.picker-item[data-picker-value="' + e + '"]').index();
                "undefined" != typeof r && -1 !== r || (r = 0);
                var o = -r * v + w;
                n(p.wrapper, "translate3d(0," + o + "px,0)"), i(p.wrapper, t + "ms"), p.updateItems(r, o, t, a)
            }, p.updateItems = function (e, t, o, l) {
                "undefined" == typeof t && (t = a(p.wrapper[0], "y")), "undefined" == typeof e && (e = -Math.round((t - w) / v)), 0 > e && (e = 0), e >= p.items.length && (e = p.items.length - 1);
                var c = p.activeIndex;
                p.wrapper.find(".picker-selected").removeClass("picker-selected"), i(p.items, o);
                var u = p.items.eq(e).addClass("picker-selected");
                if (n(u, ""), r.params.rotateEffect) {
                    (t - (Math.floor((t - w) / v) * v + w)) / v;
                    p.items.each(function () {
                        var e = $(this), i = e.index() * v, a = w - t, r = i - a, o = r / v,
                            l = Math.ceil(p.height / v / 2) + 1, c = -18 * o;
                        c > 180 && (c = 180), -180 > c && (c = -180), Math.abs(o) > l ? e.addClass("picker-item-far") : e.removeClass("picker-item-far"), n(e, "translate3d(0, " + (-t + w) + "px, " + (s ? -110 : 0) + "px) rotateX(" + c + "deg)")
                    })
                }
                (l || "undefined" == typeof l) && (p.value = u.attr("data-picker-value"), p.displayValue = p.displayValues ? p.displayValues[e] : p.value, c != e && (p.onChange && p.onChange(r, p.value, p.displayValue), r.updateValue()))
            }, o && p.updateItems(0, w, 0);
            var x, k, T, C, S, O, I, E, j, L, F, N, D = !0;
            p.initEvents = function (e) {
                var t = /hp-tablet/gi.test(navigator.appVersion), n = "ontouchstart" in window && !t,
                    i = n ? "touchstart" : "mousedown", a = n ? "touchmove" : "mousemove",
                    r = n ? "touchend" : "mouseup", o = e ? "off" : "on";
                p.container[o](i, l), p.container[o](a, c), p.container[o](r, u), "mouseup" == r && document.documentElement.addEventListener("mouseleave", u, !1), p.items[o]("click", d)
            }, p.destroyEvents = function () {
                p.initEvents(!0)
            }, p.initEvents()
        }
    }, r.columnHTML = function (e, t) {
        var n = "", i = "";
        if (e.divider) i += '<div class="picker-items-col picker-items-col-divider ' + (e.textAlign ? "picker-items-col-" + e.textAlign : "") + " " + (e.cssClass || "") + '">' + e.content + "</div>"; else {
            for (var a = 0; a < e.values.length; a++) n += '<div class="picker-item" data-picker-value="' + e.values[a] + '">' + (e.displayValues ? e.displayValues[a] : e.values[a]) + "</div>";
            i += '<div class="picker-items-col ' + (e.textAlign ? "picker-items-col-" + e.textAlign : "") + " " + (e.cssClass || "") + '"><div class="picker-items-col-wrapper">' + n + "</div></div>"
        }
        return t ? n : i
    }, r.layout = function () {
        var e, t = "", n = "";
        r.cols = [];
        var i = "";
        for (e = 0; e < r.params.cols.length; e++) {
            var a = r.params.cols[e];
            i += r.columnHTML(r.params.cols[e]), r.cols.push(a)
        }
        n = "picker-modal picker-columns " + (r.params.cssClass || "") + (r.params.rotateEffect ? " picker-3d" : ""), t = '<div class="' + n + '"><div class="picker-modal-inner picker-items">' + i + '<div class="picker-center-highlight"></div></div></div>', r.pickerHTML = t
    }, r.init = function () {
        r.initialized || (r.layout(), r.container = $(r.pickerHTML), r.container.addClass("picker-modal-inline"), $(r.params.container).html(r.container), r.container.find(".picker-items-col").each(function () {
            var e = !0;
            (!r.initialized && r.params.value || r.initialized && r.value) && (e = !1), r.initPickerCol(this, e)
        }), r.value ? r.setValue(r.value, 0) : r.params.value && r.setValue(r.params.value, 0)), r.initialized = !0
    }, r.init(), r
};
!function (e, t) {
    return e.picker = function (e) {
        return new Picker(e)
    }, e
}(bui || {}, libs), function (e, t) {
    return e.pickerdate = function () {
        function n(e) {
            return e && e.constructor == Date ? e : e && "string" == typeof e ? (e = e.replace(/-/gim, "/").replace(/^(\d+\/\d+?)($|\s)/, function (e, t) {
                return t + "/1"
            }), new Date(e)) : "number" == typeof e ? new Date(e) : new Date
        }

        function i(e, t) {
            var e, t, n = new Date;
            return n.getTime() < e.getTime() ? e : n.getTime() > t.getTime() ? t : n
        }

        function a(a) {
            function r(e) {
                var t = new Date("1970/1/1");
                return L.forEach(function (n, i) {
                    t["set" + n](e[O[n]].value - ("Month" == n ? 1 : 0))
                }), t
            }

            function o(e) {
                var t = n(e);
                return L.map(function (e, n) {
                    return t["get" + e]() + ("Month" == e ? 1 : 0)
                })
            }

            function l(e) {
                t(this).hasClass("disabled") || S && !S.isOpen() && S.open(function () {
                })
            }

            function s(t) {
                T.self = this == window || this == T ? null : this, e.trigger.apply(T, arguments)
            }

            var c, u = e.guid(), d = {
                id: u,
                height: 260,
                popup: !0,
                mask: !0,
                position: "bottom",
                buttons: [{name: "取消", className: ""}, {name: "确定", className: "primary-reverse"}],
                onMask: function () {
                    S && S.close()
                },
                callback: null
            }, f = t.extend(!0, {}, d, a);
            f.callback = function () {
                var e = a.callback && a.callback.call(this);
                1 != e && "undefined" != typeof e || ("取消" == t(this).text().trim() || "cancel" == t(this).text().trim() || "关闭" == t(this).text().trim() ? T.value(c) : c = T.value())
            };
            var h, p, g, v, m, b, w, y, x, k, T = this, C = function () {
            }, S = null, O = {}, I = ["FullYear", "Month", "Date"], E = ["Hours", "Minutes", "Seconds"], j = {
                FullYear: "year",
                Month: "month",
                Date: "date",
                Hours: "hour",
                Minutes: "minute",
                Seconds: "second"
            }, L = [], F = !1;
            this.config = {}, this.option = function () {
            }, this.cols = function (e) {
                return e = e || {}, y = [], x = [], w = [], O = {}, L = [], I.forEach(function (t, n) {
                    "none" !== e[j[t]] && (L.push(t), y.push(t))
                }), E.forEach(function (t, n) {
                    "none" !== e[j[t]] && (L.push(t), x.push(t))
                }), y.forEach(function (t, n) {
                    O[t] = w.length, w.push(P[t](e[j[t]]))
                }), x.forEach(function (t, n) {
                    0 == n && 0 != y.length ? w.push(P.Space()) : w.push(P.Divider()), O[t] = w.length, w.push(P[t](e[j[t]]))
                }), T.picker && (T.picker.params.cols = w, T.picker.initialized = !1, T.picker.init()), F = !1, this
            }, this.id = function (e) {
                e && !v && (v = e)
            }, this.reset = function () {
                return T.picker && (T.picker.initialized = !1, T.picker.init()), this
            }, this.min = function (e) {
                return p = n(e || f.min || "1960/01/01 00:00:00"), this
            }, this.max = function (e) {
                return g = n(e || f.max || "2030/01/01 00:00:00"), this
            }, this.value = function (e) {
                if (e) {
                    var t = n(e), i = o(t);
                    return T.picker.setValue(i, 0), this
                }
                return b(T.picker, T.value, T.displayValue)
            }, this.handle = function (t) {
                if (t && h !== t) {
                    var n = e.obj(h);
                    n && n.off("click", l), n = e.obj(t), n && n.on("click", l), l.hasOpen = !1, h = t
                }
                return this
            };
            var N = {
                y: function (e, t) {
                    return e.getFullYear().toString().slice(-t)
                }, M: function (e, t) {
                    var n = t > 1 ? "0" : "";
                    return (n + (e.getMonth() + 1)).slice(-2)
                }, d: function (e, t) {
                    var n = t > 1 ? "0" : "";
                    return (n + e.getDate()).slice(-2)
                }, h: function (e, t) {
                    var n = t > 1 ? "0" : "";
                    return (n + e.getHours()).slice(-2)
                }, m: function (e, t) {
                    var n = t > 1 ? "0" : "";
                    return (n + e.getMinutes()).slice(-2)
                }, s: function (e, t) {
                    var n = t > 1 ? "0" : "";
                    return (n + e.getSeconds()).slice(-2)
                }
            };
            this.formatValue = function (e) {
                return b = function (t, n, i) {
                    var a = r(t.cols);
                    return e.replace(/y+|M+|d+|h+|m+|s+/g, function (e) {
                        return N[e[0]](a, e.length)
                    })
                }, T.picker && T.picker.updateValue(), F = !1, this
            }, this.onChange = function (e) {
                return m = e || C, s.call(this, "change", k), this
            }, this.popup = function (n) {
                if (f.popup && !S) {
                    var i = '<div id="' + u + '" class="bui-dialog" >';
                    i += '<div class="bui-dialog-main"><div id="' + u + '-picker"></div></div>', f.buttons && f.buttons.length && (i += '<div class="bui-dialog-foot bui-box">', t.each(f.buttons, function (e, t) {
                        var n = "object" == typeof t && "className" in t ? " " + t.className : "",
                            a = "object" == typeof t && "name" in t ? t.name : t;
                        i += '<div class="span1"><div class="bui-btn' + n + '">' + a + "</div></div>"
                    }), i += "</div>"), i += "</div>";
                    t(i).appendTo(document.body);
                    v = e.obj(u + "-picker")
                }
                return this
            };
            var D = function (e, t, n) {
                var i = r(e.cols), a = p["get" + t](), o = g["get" + t](), l = i.getTime(), s = p.getTime(),
                    c = g.getTime();
                return s > l && i["get" + t]() < a ? ("Month" == t && (a += 1), void e.cols[O[t]].setValue(a)) : l > c && i["get" + t]() > o ? ("Month" == t && (o += 1), void e.cols[O[t]].setValue(o)) : void (n && (s > l || l > c) && e.cols[O[n]].onChange(e))
            }, P = {};
            P.FullYear = function (e) {
                return e = e || {
                    values: function () {
                        for (var e = [], t = p.getFullYear(), n = g.getFullYear(), i = t; n >= i; i++) e.push(i);
                        return e
                    }()
                }, {
                    values: e.values, displayValues: e.displayValues, onChange: function (e, t, n) {
                        D(e, "FullYear", O.Month ? "Month" : "")
                    }
                }
            }, P.Month = function (e) {
                return e = e || {
                    values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
                    displayValues: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
                }, {
                    values: e.values, displayValues: e.displayValues, textAlign: "right", onChange: function (e, t, n) {
                        for (var i = new Date(e.cols[O.FullYear].value, parseInt(e.cols[O.Month].value), 0).getDate(), a = [], r = 1; i >= r; r++) a.push(r);
                        var o = e.cols[O.Date];
                        o && o.replaceValues && o.replaceValues(a, null, o.value < i ? o.value : i), D(e, "Month", O.Date ? "Date" : "")
                    }
                }
            }, P.Date = function (e) {
                return e = e || {
                    values: function () {
                        var e = 31, t = [];
                        do t.unshift(e); while (e--);
                        return t
                    }()
                }, {
                    values: e.values, displayValues: e.displayValues, onChange: function (e, t, n) {
                        D(e, "Date", O.Hours ? "Hours" : "")
                    }
                }
            }, P.Space = function () {
                return {divider: !0, content: "  "}
            }, P.Hours = function (e) {
                return e = e || function () {
                    for (var e = [], t = [], n = 0; 24 > n; n++) e.push(n), t.push(("0" + n).slice(-2));
                    return {values: e, displayValues: t}
                }(), {
                    values: e.values, displayValues: e.displayValues, onChange: function (e, t, n) {
                        D(e, "Hours", O.Minutes ? "Minutes" : "")
                    }
                }
            }, P.Divider = function () {
                return {divider: !0, textAlign: "center", content: ":"}
            }, P.Minutes = function (e) {
                return e = e || function () {
                    for (var e = [], t = [], n = 0; 60 > n; n++) e.push(n), t.push(("0" + n).slice(-2));
                    return {values: e, displayValues: t}
                }(), {
                    values: e.values, displayValues: e.displayValues, onChange: function (e, t, n) {
                        D(e, "Minutes", O.Seconds ? "Seconds" : "")
                    }
                }
            }, P.Seconds = function (e) {
                return e = e || function () {
                    for (var e = [], t = [], n = 0; 60 > n; n++) e.push(n), t.push(("0" + n).slice(-2));
                    return {values: e, displayValues: t}
                }(), {
                    values: e.values, displayValues: e.displayValues, onChange: function (e, t, n) {
                        D(e, "Seconds")
                    }
                }
            }, T.min(f.min), T.max(f.max), T.cols(f.cols), T.onChange(f.onChange), T.formatValue(f.formatValue || "yyyy-MM-dd hh:mm:ss"), T.id(f.id), T.handle(f.handle), T.popup(f), T.picker = e.picker({
                container: v,
                rotateEffect: !0,
                value: o(f.value ? n(f.value) : i(p, g)),
                onChange: function (e, t, n) {
                    var i = b(e, t, n);
                    k != i && (k = i, m(i), s.call(this, "change", i))
                },
                cols: w
            }), f.popup && !S && (S = e.dialog(f), S && S.on("open", function () {
                c = b(T.picker, T.value, T.displayValue), s.call(this, "show")
            }), S && S.on("close", function () {
                s.call(this, "hide")
            })), this.disabled = function () {
                var t = e.obj(h);
                return t && t.addClass("disabled"), this
            }, this.enabled = function () {
                var t = e.obj(h);
                return t && t.removeClass("disabled"), this
            }, this.widget = function (t) {
                var n = {dialog: S || {}};
                return e.widget.call(n, t)
            }, this.on = function (t, n) {
                return e.on.apply(T, arguments), this
            }, this.off = function (t, n) {
                return e.off.apply(T, arguments), this
            }
        }

        return function (e) {
            return new a(e)
        }
    }(), e
}(bui || {}, libs), function (e, t) {
    return e.ajax = function (n) {
        function i(e) {
            ajaxHandle = t.ajax({
                async: e.async,
                url: e.url,
                data: e.data,
                type: e.method,
                dataType: e.dataType,
                headers: e.headers,
                contentType: e.contentType,
                timeout: e.timeout,
                processData: e.processData,
                mimeType: e.mimeType,
                cache: e.cache,
                success: function (t, n, i) {
                    var r;
                    if ("string" == typeof t) try {
                        r = JSON.parse(t)
                    } catch (o) {
                        r = t
                    } else r = t || {};
                    e.success && e.success(r, n, i), a.resolve(r, n, i)
                },
                error: function (t, n, i) {
                    var r;
                    if ("string" == typeof t) try {
                        r = JSON.parse(t)
                    } catch (o) {
                        r = t
                    } else r = t || {};
                    e.fail && e.fail(r, n, i), a.reject(r, n, i)
                }
            })
        }

        var a = t.Deferred(), r = {
            data: {},
            method: "GET",
            dataType: "json",
            timeout: 6e4,
            headers: {},
            processData: !0,
            mimeType: "none",
            cache: !1,
            async: !0,
            contentType: "",
            "native": !0
        }, o = t.extend(!0, {}, r, e.config.ajax, n);
        return "" === o.contentType && "GET" == o.method ? o.contentType = "text/html;charset=UTF-8" : "" === o.contentType && "POST" == o.method ? o.contentType = "application/x-www-form-urlencoded" : o.contentType = o.contentType, o.url ? 0 === o.url.indexOf("//") ? (e.showLog("url格式需要以http://或者https://开头", "bui.ajax"), a) : (e.isWebapp || !o["native"] ? i(o) : a = e["native"].ajax && e["native"].ajax(o) || a, a.abort = function () {
            ajaxHandle && ajaxHandle.abort()
        }, a) : (e.showLog("url不能为空", "bui.ajax"), a)
    }, e
}(bui || {}, libs), function (e, t) {
    return e.load = function (n) {
        var i, a = {url: "", param: {}, replace: !1, "native": !0}, r = t.extend(!0, {}, a, e.config.load, n);
        if (!r.url) return void e.showLog("url 不能为空!", "bui.load:web");
        try {
            r.param = "string" == typeof r.param && JSON.parse(r.param) || r.param || {}
        } catch (o) {
            return void e.showLog("param 参数值必须是一个{}对象", "bui.load:web")
        }
        return document.activeElement.blur(), i = e.setUrlParams(r.url, r.param), !r.replace || "load" in window.router ? void ("load" in window.router ? window.router.load && window.router.load(r) : r["native"] && !e.isWebapp ? e["native"].load && e["native"].load(r) : window.location.href = i) : void window.location.replace(i)
    }, e
}(bui || {}, libs), function (e, t) {
    return e.getPageParams = function (n) {
        var i = t.Deferred(), a = {callback: null, "native": !0};
        n = n || {};
        var r = t.extend(!0, {}, a, e.config.getPageParams);
        if ("function" == typeof n ? r.callback = n : n && "object" === e["typeof"](n) && (r = t.extend(!0, {}, a, e.config.getPageParams, n)), "getPageParams" in window.router) {
            var o = window.router.getPageParams && window.router.getPageParams();
            r.callback && r.callback(o), i.resolve(o)
        } else if (r["native"] && !e.isWebapp) i = e["native"].getPageParams && e["native"].getPageParams(r) || i; else {
            var l = e.getUrlParams();
            r.callback && r.callback(l), i.resolve(l)
        }
        return i
    }, e
}(bui || {}, libs), function (e, t) {
    return e.back = function (n) {
        function i() {
            a.refresh || -1 !== a.index ? window.history.go(a.index) : window.history.back(), a.callback && a.callback()
        }

        var a, r = {index: -1, name: "", refresh: !1, "native": !0, callback: null};
        if ("function" == typeof n ? (r.callback = n, a = t.extend(!0, {}, r, e.config.back)) : a = n && "object" === e["typeof"](n) ? t.extend(!0, {}, r, e.config.back, n) : t.extend(!0, {}, r, e.config.back), "back" in window.router) if (window.router.config.syncHistory) {
            var o = router.getHistory(), l = o.length - 1;
            if (a.name) {
                var s = e.inArray(a.name, o, "pid");
                a.index = s > 0 ? -(o.length - s - 1) : -1
            }
            Math.abs(a.index) > l && (a.index = -l), o.length > 1 && i()
        } else window.router.back && window.router.back(a); else a["native"] && !e.debug ? e["native"].back && e["native"].back(a) : i()
    }, e
}(bui || {}, libs), function (e, t) {
    return e.refresh = function (n) {
        var i = {"native": !0}, a = t.extend(!0, {}, i, e.config.refresh, n);
        "refresh" in window.router ? window.router.refresh && window.router.refresh() : a["native"] && !e.isWebapp ? e["native"].refresh && e["native"].refresh() : window.location.reload(!0)
    }, e
}(bui || {}, libs), function (e, t) {
    return e.run = function (n) {
        var i = {}, a = {id: "", name: "", data: null, onFail: null, "native": !0};
        if ("string" == typeof n ? i.id = n : n && "object" === e["typeof"](n) && (i = t.extend(!0, {}, a, e.config.run, n)), e.isWebapp || !i["native"]) {
            if (String(i.id).indexOf("http://") > -1) {
                var r = e.setUrlParams(i.id, i.data), o = window.open("", "_newtab");
                o.location = r
            }
        } else e["native"].run && e["native"].run(i)
    }, e
}(bui || {}, libs), function (e, t) {
    return e.fileselect = function (n) {
        function i(t) {
            return w = [], y ? o() : h = e["native"].fileselect && e["native"].fileselect(t, {module: v}) || {}, this
        }

        function a(n) {
            m = null;
            var i = this, a = t.extend(!0, g, n);
            return b = a, y ? (f.off("change").on("change", function () {
                var t = this.files;
                if (t.length < 1) return void (a.onFail && a.onFail.call(i, t, w));
                t.length > 1 && e.showLog("一次只能选一张图片", "bui.fileselect:web"), m = t[0];
                try {
                    if (!bui.compareArray(t[0].name, w, "name")) {
                        var n = {name: t[0].name, data: t[0], type: t[0].type, size: t[0].size};
                        w.push(n)
                    }
                } catch (r) {
                    e.showLog(r, "bui.fileselect:web")
                }
                a.onSuccess && a.onSuccess.call(i, t, w)
            }), e.platform.isIos() ? f[0].dispatchEvent(new Event("click")) : f.trigger("click")) : h.add.bind(i)(a), this
        }

        function r(e) {
            function t(e) {
                var t = new FileReader;
                t.onloadend = function (t) {
                    var n = new Image, a = !1, r = b.width || 800, o = b.quality || .8,
                        l = document.createElement("canvas"), s = l.getContext("2d");
                    n.src = this.result, n.onload = function () {
                        return a ? void 0 : (l.width = r, l.height = r * (n.height / n.width), s.drawImage(n, 0, 0, l.width, l.height), n.src = l.toDataURL("image/jpeg", o), i && i.call(v, n.src, e), void (a = !0))
                    }
                }, t.readAsDataURL(e)
            }

            var e = e || {}, n = e.data || m, i = e.onSuccess || function () {
            };
            e.onFail || function () {
            };
            if (y) try {
                t(n)
            } catch (a) {
            } else h.toBase64(e);
            return this
        }

        function o() {
            if (void 0 == f) {
                d = bui.guid();
                var e = '<input type="file" name="uploadFiles" id="' + d + '" style="display:none"/>';
                t("body").append(e), f = t("#" + d) || t('input[name="uploadFiles"]')
            }
        }

        function l(e, t) {
            var t = t || "name";
            if (!y) return w = h.remove(e, t);
            if ("string" == typeof e) {
                w = bui.removeArray(e, w, t);
                var n = w.length ? w[w.length - 1].data : null;
                return m = n, w
            }
            return this
        }

        function s() {
            return w = [], m = null, y || h.clear(), w
        }

        function c() {
            return w = y ? w : h.data()
        }

        function u() {
            return m = y ? m : h.value()
        }

        var d, f, h, p = {"native": !0, quality: .8, width: 800, height: 800, mediaType: "picture"},
            g = t.extend(!0, {}, p, e.config.fileselect, n),
            v = {add: a, remove: l, clear: s, value: u, data: c, toBase64: r, init: i}, m = null, b = null, w = [],
            y = e.isWebapp || !g["native"];
        return i(g), v
    }, e
}(bui || {}, libs), function (e, t) {
    return e.file = function (n) {
        function i(t) {
            return b = e.fileselect(t), g = a(t), v = r({root: !0, create: !0}), this
        }

        function a(n) {
            function i(e) {
                var t = "";
                switch (e.code) {
                    case FileError.QUOTA_EXCEEDED_ERR:
                        t = "QUOTA_EXCEEDED_ERR";
                        break;
                    case FileError.NOT_FOUND_ERR:
                        t = "NOT_FOUND_ERR";
                        break;
                    case FileError.SECURITY_ERR:
                        t = "SECURITY_ERR";
                        break;
                    case FileError.INVALID_MODIFICATION_ERR:
                        t = "INVALID_MODIFICATION_ERR";
                        break;
                    case FileError.INVALID_STATE_ERR:
                        t = "INVALID_STATE_ERR";
                        break;
                    default:
                        t = "Unknown Error"
                }
                var n = {msg: t};
                a.reject(n)
            }

            var a = t.Deferred();
            return webapp ? (h = "bui.app", p = window, m = 1024 * parseInt(T.size) * 1024, window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem, navigator.webkitPersistentStorage && navigator.webkitPersistentStorage.requestQuota(m, function (e) {
                window.requestFileSystem(window.PERSISTENT, e, function (e) {
                    a.resolve(e)
                }, i)
            })) : w = e["native"].file && e["native"].file(n, {fileselect: b, module: k}) || {}, a
        }

        function r(e) {
            var n = {
                folderName: h,
                root: !1,
                create: !1,
                msg: "",
                param: {create: !1, exclusive: !1},
                onSuccess: null,
                onFail: null
            }, i = t.extend({}, n, e), a = "";
            if (i.create ? (a = "创建 ", i.param.create = !0) : (a = "获取 ", i.param.create = !1), webapp) {
                var r = o(i.folderName);
                r = i.root ? r : h + "/" + r, g.done(function (e) {
                    e.root.getDirectory(r, i.param, function (t) {
                        i.onSuccess && i.onSuccess.call(k, t, e)
                    }, function (e) {
                        var t = {msg: a + r + " 文件夹失败"};
                        i.onFail && i.onFail.call(k, t)
                    })
                }).fail(function (e) {
                    var t = {msg: "文件系统还没准备好."};
                    i.onFail && i.onFail.call(k, t)
                })
            } else w.getFolder(i);
            return this
        }

        function o(e) {
            var t;
            return "." == e[0] || "/" == e[0] || " " == e[0] ? (t = e.slice(1), o(t)) : "." != e[0] && "/" != e[0] && " " != e[0] ? e : void 0
        }

        function l(e) {
            var t;
            return e && e.indexOf("/") > -1 ? t = e.slice(e.lastIndexOf("/") + 1, e.indexOf("?") > -1 ? e.indexOf("?") : void 0) : e
        }

        function s(e) {
            var n = {
                fileName: "",
                folderName: "",
                root: !1,
                create: !1,
                param: {create: !1, exclusive: !1},
                onSuccess: null,
                onFail: null
            }, i = t.extend({}, n, e), a = "";
            if (i.create ? (a = "创建 ", i.param.create = !0) : (a = "获取 ", i.param.create = !1), !i.fileName || i.fileName.indexOf(".") < 0) return void (i.onFail && i.onFail());
            if (webapp) {
                var o = l(i.fileName);
                r({
                    root: i.root, folderName: i.folderName, create: !0, onSuccess: function (e, t) {
                        var n = e.name == h ? e.name + "/" + o : h + "/" + e.name + "/" + o;
                        t.root.getFile(n, i.param, function (e) {
                            y = e, i.onSuccess && i.onSuccess.call(k, e, t)
                        }, function (e) {
                            var t = {msg: a + o + " 文件失败"};
                            i.onFail && i.onFail.call(k, t)
                        })
                    }, onFail: function (e) {
                        i.onFail && i.onFail(e)
                    }
                })
            } else w.getFile(i);
            return this
        }

        function c(e) {
            var n = t.extend(!0, {}, e);
            return webapp ? r({
                root: n.root, folderName: n.folderName, create: n.create, onSuccess: function (e, t) {
                    e.removeRecursively(function () {
                        n.onSuccess && n.onSuccess.call(k, e, t)
                    }, function (t) {
                        var i = {msg: "删除 " + n.folderName + " 文件失败"};
                        n.onFail && n.onFail.call(k, i, e)
                    })
                }, onFail: function (e) {
                    var t = {msg: "删除 " + n.folderName + " 文件失败"};
                    n.onFail && n.onFail.call(k, t)
                }
            }) : w.removeFolder(n), this
        }

        function u(e) {
            var n = t.extend(!0, {}, e);
            return webapp ? s({
                root: n.root,
                create: n.create,
                folderName: n.folderName,
                fileName: n.fileName,
                onSuccess: function (e, t) {
                    e.remove(function () {
                        n.onSuccess && n.onSuccess.call(k, e, t)
                    }, function (t) {
                        var i = {msg: "删除 " + n.fileName + " 文件失败"};
                        n.onFail && n.onFail.call(k, i, e)
                    })
                },
                onFail: function (e) {
                    var t = {msg: "删除 " + n.fileName + " 文件失败"};
                    n.onFail && n.onFail.call(k, t)
                }
            }) : w.removeFile(n), this
        }

        function d(t) {
            var n = t || {};
            if (n.url) {
                l(n.url);
                return webapp ? e.showLog("web暂不支持open方法", "bui.file.open:web") : w.open(n), this
            }
        }

        function f(e) {
            return b.toBase64(e), this
        }

        var h, p, g, v, m, b, w, y, x = {size: 10, "native": !0}, k = {
            getFolder: r,
            removeFolder: c,
            getFile: s,
            getFileName: l,
            removeFile: u,
            toBase64: f,
            open: d,
            init: i
        }, T = k.config = t.extend(!0, {}, x, e.config.file, n);
        return floderData = "", webapp = e.isWebapp || "undefined" == typeof cordova || 0 == T["native"], i(T), k
    }, e
}(bui || {}, libs), function (e, t) {
    return e.upload = function (n) {
        function i(t) {
            return v = e.loading({
                callback: function () {
                    u()
                }
            }), m = e.fileselect({
                "native": t["native"],
                mediaType: t.mediaType
            }), E || (w = e["native"].upload && e["native"].upload(t, {
                loading: v,
                fileselect: m,
                module: S
            }) || {}), t.data ? (c(t), this) : this
        }

        function a(e) {
            var t = m.add.bind(S);
            return t(e), this
        }

        function r(e, t) {
            return m.remove(e, t), this
        }

        function o() {
            return m.clear(), this
        }

        function l(e) {
            return m.toBase64(e), this
        }

        function s() {
            return m.data()
        }

        function c(e) {
            var n = t.extend(!0, {}, C, e);
            return x = n.url, n.data = y = n.data || m.value(), O = n.showProgress, y ? (O && v.show(), E ? d(n) : w.start(n), this) : void 0
        }

        function u(e) {
            return E ? (v && v.stop(), b && b.abort(), e && e.call(S, v, b)) : w.stop(e), this
        }

        function d(e) {
            e.cache = !1, e.contentType = !1, e.processData = !1, e.method = "POST";
            var n = e.onSuccess, i = e.onFail, a = new FormData;
            return a.append(e.fileKey, y), b = t.ajax({
                url: x,
                type: e.method,
                data: a,
                cache: e.cache,
                headers: e.headers,
                contentType: e.contentType,
                processData: e.processData,
                timeout: e.timeout,
                xhr: function () {
                    var e = t.ajaxSettings.xhr();
                    return f && e.upload ? (e.upload.addEventListener("progress", f, !1), e) : void 0
                },
                success: function (e) {
                    p(), n && n.call(S, e)
                },
                fail: function (e, t) {
                    p(), i && i.call(S, e, t)
                }
            }), this
        }

        function f(e) {
            window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame, window.requestAnimationFrame(function () {
                if (e.lengthComputable) {
                    var t = Math.round(100 * e.loaded / e.total);
                    k = t.toString() + "%", 100 > t ? h(k) : p(), I && I.call(S, k)
                }
            })
        }

        function h(e) {
            return v && v.show({text: e}), this
        }

        function p() {
            return v && v.stop(), this
        }

        function g(t) {
            var n = {loading: v, fileselect: m, ajax: b};
            return e.widget.call(n, t)
        }

        var v, m, b, w, y, x, k, T = {
                url: "",
                data: null,
                headers: {},
                showProgress: !0,
                timeout: 6e4,
                "native": !0,
                fileKey: "file",
                mimeType: "image/jpeg",
                mediaType: "allmedia",
                onProgress: null,
                onSuccess: null,
                onFail: null
            }, C = t.extend(!0, {}, T, e.config.upload, n),
            S = {init: i, add: a, remove: r, clear: o, data: s, start: c, stop: u, toBase64: l, widget: g},
            O = C.showProgress, I = C.onProgress, E = e.isWebapp || !C["native"];
        return i(C), S
    }, e
}(bui || {}, libs), function (e, t) {
    return e.download = function (n) {
        function i(t) {
            function n(e) {
                h.getFolder({
                    folderName: e.folderName, create: !1, onSuccess: function (e, t) {
                        m = e.fullPath
                    }, onFail: function (t) {
                        h.getFolder({
                            folderName: e.folderName, create: !0, onSuccess: function (e, t) {
                                m = e.fullPath
                            }, onFail: function (e) {
                                O && O(e)
                            }
                        })
                    }
                }), e.url && a(e)
            }

            return y = e.loading({
                callback: function () {
                    o()
                }
            }), h = e.file({"native": t["native"]}), C ? n(t) : p = e["native"].download && e["native"].download(t, {
                file: h,
                loading: y,
                module: k
            }) || {}, this
        }

        function a(e) {
            var n = t.extend(!0, {}, T, e);
            g = n.url, v = encodeURI(g), S = n.onProgress, n.showProgress && y.show({text: "0%"}), b = m + "/" + (e.fileName || h.getFileName(g)), C ? (n.cache = !1, n.contentType = !1, n.processData = !1, f = t.ajax({
                url: v,
                type: n.method,
                data: n.data,
                cache: n.cache,
                headers: n.headers,
                contentType: n.contentType,
                processData: n.processData,
                timeout: n.timeout,
                xhr: function () {
                    var e = t.ajaxSettings.xhr();
                    return l && e ? (e.addEventListener("progress", l, !1), e) : void 0
                },
                success: function (t) {
                    var i = e.fileName || h.getFileName(n.url);
                    h.getFile({
                        fileName: i, folderName: n.folderName, create: !0, onSuccess: function (e, t) {
                            n.onSuccess && n.onSuccess.call(k, e.fullPath, t)
                        }
                    })
                },
                fail: function (e) {
                    c(), n.onFail && n.onFail.call(k, e)
                }
            })) : p.start(n)
        }

        function r(e) {
            var n = t.extend(!0, {autoDown: !0}, T, e), i = e.fileName || h.getFileName(n.url);
            h.getFile({
                fileName: i, folderName: n.folderName, onSuccess: function (e, t) {
                    n.onSuccess && n.onSuccess.call(k, e.fullPath, e, t)
                }, onFail: function (e) {
                    n.autoDown = a(n)
                }
            })
        }

        function o(e) {
            C ? (c(), f && f.abort()) : p.stop(), e && e.call(k, y, f)
        }

        function l(e) {
            window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame, window.requestAnimationFrame(function () {
                if (e.lengthComputable) {
                    var t = Math.round(100 * e.loaded / e.total);
                    w = t.toString() + "%", 100 > t ? s(w) : c(), S && S.call(k, w)
                }
            })
        }

        function s(e) {
            y && y.show({text: e})
        }

        function c() {
            y && y.stop()
        }

        function u(e) {
            return h.toBase64(e), this
        }

        function d(t) {
            var n = {loading: y, file: h, ajax: f};
            return e.widget.call(n, t)
        }

        var f, h, p, g, v, m, b, w, y, x = {
                url: "",
                data: {},
                headers: {},
                method: "GET",
                showProgress: !0,
                timeout: 6e4,
                fileName: "",
                folderName: "download",
                "native": !0,
                onProgress: null,
                onSuccess: null,
                onFail: null
            }, k = {getFile: r, start: a, stop: o, toBase64: u, init: i, widget: d},
            T = k.config = t.extend(!0, {}, x, e.config.download, n), C = e.isWebapp || 0 == T["native"],
            S = (T.showProgress, T.onProgress), O = T.onFail;
        return i(T), k
    }, e
}(bui || {}, libs), function (e, t) {
    return e.ready = function (n) {
        e.isWebapp = "undefined" == typeof e.isWebapp ? e.debug : e.isWebapp;
        var i = t.Deferred();
        if (e.isWebapp) t(document).ready(function () {
            n && n(), e.trigger.call(e, "pageready"), i.resolve()
        }); else {
            if ("undefined" == typeof e["native"].ready) return e.showLog("当前bui.js为webapp版本,不支持原生方法,请更换bui.js为对应平台版本"), i;
            i = e["native"].ready && e["native"].ready(n) || i
        }
        return i
    }, e
}(bui || {}, libs), function (e, t) {
    e.init = function (n) {
        var i, a = {id: ".bui-page", height: 0, header: "header", main: "main", footer: "footer"};
        if ("object" == e["typeof"](n)) i = t.extend({}, a, e.config.init, n); else {
            var r = {};
            r.height = n, i = t.extend({}, a, r)
        }
        var o = i.height || document.documentElement.clientHeight;
        if (!(t(i.main).length < 1)) {
            try {
                var l = t(i.id), s = i.header.indexOf("#") > -1 ? e.obj(i.header)[0] : l.children(i.header)[0],
                    c = i.footer.indexOf("#") > -1 ? e.obj(i.footer)[0] : l.children(i.footer)[0],
                    u = i.main.indexOf("#") > -1 ? e.obj(i.main) : l.children(i.main), d = s ? s.offsetHeight : 0,
                    f = c ? c.offsetHeight : 0, h = o - d - f;
                u.height(h)
            } catch (p) {
                e.showLog(p, "bui.init")
            }
            return h
        }
    }, window.onload = function () {
        e.trigger.call(e, "onload")
    }, window.loader = e.loader(), e.define = loader.define, e.require = loader.require, t(document).ready(function () {
        e.isWebapp = "undefined" == typeof e.isWebapp ? e.debug : e.isWebapp, e.trigger.call(e, "pagebefore"), e.platform.isWindow() || e.platform.isMac() ? window.viewport = e.viewport(60) : e.platform.isIpad() ? window.viewport = e.viewport(70) : window.viewport = e.viewport(), e.config.init.auto && e.init(), "function" == typeof FastClick && FastClick.attach(document.body), e.trigger.call(e, "pageinit")
    });
    try {
        navigator.control.gesture(!1), navigator.control.longpressMenu(!1)
    } catch (n) {
    }
    return "function" == typeof define && "object" == typeof define.amd && define.amd ? define("bui", [libs], function () {
        return e
    }) : "undefined" != typeof module && module.exports ? module.exports.bui = e : window.bui = e, e
}(bui || {}, libs);